Move the BindToTree call for the document element into SetRootContent. Bug

289209, r=sicking, sr=jst, a=asa
This commit is contained in:
bzbarsky%mit.edu 2005-11-02 07:42:57 +00:00
Родитель 745957e021
Коммит 76f54b84d0
3 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -249,14 +249,13 @@ void txMozillaTextOutput::createResultDocument(nsIDOMDocument* aSourceDocument,
return;
}
rv = rootContent->BindToTree(doc, nsnull, nsnull, PR_TRUE);
// XXXbz what to do on failure here?
rv = doc->SetRootContent(rootContent);
if (NS_FAILED(rv)) {
NS_ERROR("Failed to bind root to tree");
rootContent->UnbindFromTree();
NS_ERROR("Failed to set root content");
return;
}
doc->SetRootContent(rootContent);
mDocument->CreateElementNS(XHTML_NSURI,
NS_LITERAL_STRING("head"),

Просмотреть файл

@ -301,7 +301,7 @@ void txMozillaXMLOutput::endElement(const nsAString& aName, const PRInt32 aNsID)
nsCOMPtr<nsIDocument> document = do_QueryInterface(mNonAddedParent);
if (document && !mRootContent) {
mRootContent = do_QueryInterface(mCurrentNode);
mRootContent->BindToTree(document, nsnull, nsnull, PR_TRUE);
// XXXbz what to do on failure here?
document->SetRootContent(mRootContent);
}
else {
@ -493,7 +493,7 @@ void txMozillaXMLOutput::closePrevious(PRInt8 aAction)
mParentNode = wrapper;
mRootContent = do_QueryInterface(wrapper);
mRootContent->BindToTree(document, nsnull, nsnull, PR_TRUE);
// XXXbz what to do on failure here?
document->SetRootContent(mRootContent);
}
@ -504,7 +504,7 @@ void txMozillaXMLOutput::closePrevious(PRInt8 aAction)
else {
if (document && currentElement && !mRootContent) {
mRootContent = do_QueryInterface(mCurrentNode);
mRootContent->BindToTree(document, nsnull, nsnull, PR_TRUE);
// XXXbz what to do on failure here?
document->SetRootContent(mRootContent);
}
else {

Просмотреть файл

@ -712,8 +712,10 @@ txMozillaXSLTProcessor::notifyError()
return;
}
rootContent->BindToTree(document, nsnull, nsnull, PR_TRUE);
document->SetRootContent(rootContent);
rv = document->SetRootContent(rootContent);
if (NS_FAILED(rv)) {
return;
}
nsCOMPtr<nsIDOMText> text;
rv = errorDocument->CreateTextNode(mErrorText, getter_AddRefs(text));