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

289209, r=sicking, sr=jst, a=asa


git-svn-id: svn://10.0.0.236/trunk@172254 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-04-15 01:30:14 +00:00
parent 91f07a8307
commit 577af8f892
11 changed files with 62 additions and 52 deletions

View File

@@ -857,14 +857,12 @@ nsXMLContentSink::SetDocElement(PRInt32 aNameSpaceID,
mDocElement = aContent;
NS_ADDREF(mDocElement);
nsresult rv = mDocElement->BindToTree(mDocument, nsnull, nsnull, PR_TRUE);
nsresult rv = mDocument->SetRootContent(mDocElement);
if (NS_FAILED(rv)) {
mDocElement->UnbindFromTree();
// If we return PR_FALSE here, the caller will bail out because it won't
// find a parent content node to append to, which is fine.
return PR_FALSE;
}
mDocument->SetRootContent(mDocElement);
return PR_TRUE;
}