Bug 461027, r+sr=bz

This commit is contained in:
Olli Pettay 2008-12-20 01:40:00 +02:00
parent c4e089543d
commit 3abb81ab1d

View File

@ -725,6 +725,21 @@ nsXBLBinding::GenerateAnonymousContent()
if (ni->NamespaceID() != kNameSpaceID_XUL ||
(localName != nsGkAtoms::observes &&
localName != nsGkAtoms::_template)) {
// Undo InstallAnonymousContent
PRUint32 childCount = mContent->GetChildCount();
#ifdef MOZ_XUL
nsCOMPtr<nsIXULDocument> xuldoc(do_QueryInterface(doc));
#endif
for (PRUint32 k = 0; k < childCount; ++k) {
nsIContent* child = mContent->GetChildAt(k);
child->UnbindFromTree();
#ifdef MOZ_XUL
if (xuldoc) {
xuldoc->RemoveSubtreeFromDocument(child);
}
#endif
}
// Kill all anonymous content.
mContent = nsnull;
bindingManager->SetContentListFor(mBoundElement, nsnull);