Eliminate nsIContent::SetDocument/SetParent/SetBindingParent in favor of

BindToTree and UnbindFromTree methods.  Bug 286000, r=sicking, sr=jst
This commit is contained in:
bzbarsky@mit.edu
2005-04-05 23:54:35 +00:00
parent 654dc60e2d
commit 2d637b6568
55 changed files with 1372 additions and 822 deletions

View File

@@ -153,9 +153,12 @@ nsHTMLEditor::CreateAnonymousElement(const nsAString & aTag, nsIDOMNode * aPare
// establish parenthood of the element
newContent->SetNativeAnonymous(PR_TRUE);
newContent->SetParent(parentContent);
newContent->SetDocument(doc, PR_TRUE, PR_TRUE);
newContent->SetBindingParent(newContent);
res = newContent->BindToTree(doc, parentContent, newContent, PR_TRUE);
if (NS_FAILED(res)) {
newContent->UnbindFromTree();
return res;
}
// display the element
ps->RecreateFramesFor(newContent);
@@ -178,10 +181,8 @@ nsHTMLEditor::DeleteRefToAnonymousNode(nsIDOMElement* aElement,
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
if (content) {
aDocObserver->ContentRemoved(content->GetCurrentDoc(),
aParentContent, content, -1);
content->SetParent(nsnull);
content->SetBindingParent(nsnull);
content->SetDocument(nsnull, PR_TRUE, PR_TRUE);
aParentContent, content, -1);
content->UnbindFromTree();
}
}
}