зеркало из https://github.com/mozilla/pjs.git
Move the BindToTree call for the document element into SetRootContent. Bug
289209, r=sicking, sr=jst, a=asa
This commit is contained in:
Родитель
745957e021
Коммит
76f54b84d0
|
@ -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));
|
||||
|
|
Загрузка…
Ссылка в новой задаче