Bug 228124: Deal with documents without root-element in xml prettyprinter.

Patch by jst. r=me sr=bz


git-svn-id: svn://10.0.0.236/trunk@150363 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sicking%bigfoot.com 2003-12-16 19:33:09 +00:00
parent f78cfe4b66
commit dfa50bfa17

View File

@ -234,9 +234,12 @@ nsXMLPrettyPrinter::EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType)
nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(mDocument);
nsCOMPtr<nsIDOMElement> rootElem;
document->GetDocumentElement(getter_AddRefs(rootElem));
nsCOMPtr<nsIDOMDocumentXBL> xblDoc = do_QueryInterface(mDocument);
xblDoc->RemoveBinding(rootElem,
NS_LITERAL_STRING("chrome://communicator/content/xml/XMLPrettyPrint.xml#prettyprint"));
if (rootElem) {
nsCOMPtr<nsIDOMDocumentXBL> xblDoc = do_QueryInterface(mDocument);
xblDoc->RemoveBinding(rootElem,
NS_LITERAL_STRING("chrome://communicator/content/xml/XMLPrettyPrint.xml#prettyprint"));
}
mDocument = nsnull;