Hello everyone,

I'd like to inject some html code from C++ after the page has rendered (if
certain events happens) and I know this can be done in javascript. What I am
doing now is actually:

 

            nsCOMPtr<nsIDOMDocument> doc;

            nsCOMPtr<nsIDOMElement>  rootElm;

    nsCOMPtr<nsIDOMNode>  rootNode;

            nsIDOMNode *newNode;

 
_domParser->ParseFromString(mtQtGecko::QStringToPRUniChar(xhtmlCode),
"text/xml", getter_AddRefs(doc));

            doc->GetDocumentElement(getter_AddRefs(rootElm));

            rootElm->CloneNode(PR_TRUE, getter_AddRefs(rootNode));

 

            nsIDOMElement *elm = getElementById(QString("myHeader"));

            elm->AppendChild(rootNode, &newNode);

 

and it crash (I actually suspect CloneNode is not implemented into
nsDOMElement maybe?) with some "corrupted stack" values (crashes during a
delete), any ideas what am I doing wrong or if there are alternative
solutions to this? I am using Gecko 1.9 from couple of months old FF cvs
checkout.

Thanks

Daniele

_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to