From 7ad65ca897a919b17245b57d5ede23e64e5df5fb Mon Sep 17 00:00:00 2001 From: "peter%propagandism.org" Date: Tue, 5 Aug 2003 19:34:04 +0000 Subject: [PATCH] Fix for bug 215117 (SetRootContent handling in nsXMLContentSink is rotten). r=Pike, sr=jst. --- content/xml/document/src/nsXMLContentSink.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index 402240f736b2..a2182cc4ed20 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -400,8 +400,6 @@ nsXMLContentSink::DidBuildModel() } } - mDocument->SetRootContent(mDocElement); - // Check if we want to prettyprint MaybePrettyPrint(); @@ -492,13 +490,7 @@ nsXMLContentSink::OnTransformDone(nsresult aResult, // Transform succeeded or it failed and we have an error // document to display. NS_RELEASE(mDocument); - CallQueryInterface(aResultDocument, &mDocument); // addrefs - } - else - { - // Transform failed and we don't have an error document, display the - // untransformed source document. - mDocument->SetRootContent(mDocElement); + CallQueryInterface(aResultDocument, &mDocument); } nsCOMPtr loader; @@ -1746,11 +1738,7 @@ nsXMLContentSink::HandleStartElement(const PRUnichar *aName, mDocElement = content; NS_ADDREF(mDocElement); - // For XSLT, we need to wait till after the transform - // to set the root content object. - if (!mXSLTProcessor) { - mDocument->SetRootContent(mDocElement); - } + mDocument->SetRootContent(mDocElement); } else if (appendContent) { nsCOMPtr parent = GetCurrentContent();