Hi anybody,

I develop a C++-application with a HTML-UI. I manipulate the the
HTML-content through the DOM from C++-side. To make the changes
visible i call nsIPresShell::StyleChangeReflow(). This is ugly,
because the layout flickers. Can anybody tell me how to reflow only
the tag affected by the change? Here is a code-example of my
application:

[...]
else if (flag == NODE){

nsCOMPtr<nsIDOMElement> melement;
nsCOMPtr<nsIDOMText> nodetext;
nsCOMPtr<nsIDOMNode> simplenode;
nsCOMPtr<nsIDOMNode> oldnode;

////////////////////////////////////////////////////
// String operations
const int l = id.GetLength();
const int l2= text.GetLength();
nsCString idt(id.GetBuffer(l));
nsCString textt(text.GetBuffer(l2));
////////////////////////////////////////////////////
        
rv = doc->GetElementById(NS_ConvertUTF8toUCS2(idt),
getter_AddRefs(melement));
if (!NS_FAILED(rv)){                            
        doc->CreateTextNode(NS_ConvertUTF8toUCS2(textt),
getter_AddRefs(nodetext));
melement->GetFirstChild(getter_AddRefs(oldnode));
melement->ReplaceChild(nodetext, oldnode, getter_AddRefs(simplenode));
}               
}
                        
presShell->StyleChangeReflow();

[...]

I use this method for changing the text of a node in the document. Now
i want to reflow only the element with the given ID. How do i do this?

Thank you,
yours truly
Timmy

Reply via email to