mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-31 21:21:08 +00:00
Bug 529087: Fix crash involving XBL and cloned XUL elements. r=smaug
This commit is contained in:
parent
7e8118a1bf
commit
f2fa47761e
@ -269,8 +269,22 @@ nsNodeUtils::LastRelease(nsINode* aNode)
|
||||
|
||||
if (aNode->IsElement()) {
|
||||
nsIDocument* ownerDoc = aNode->GetOwnerDoc();
|
||||
Element* elem = aNode->AsElement();
|
||||
if (ownerDoc) {
|
||||
ownerDoc->ClearBoxObjectFor(aNode->AsElement());
|
||||
ownerDoc->ClearBoxObjectFor(elem);
|
||||
}
|
||||
|
||||
NS_ASSERTION(aNode->HasFlag(NODE_FORCE_XBL_BINDINGS) ||
|
||||
!ownerDoc ||
|
||||
!ownerDoc->BindingManager() ||
|
||||
!ownerDoc->BindingManager()->GetBinding(cont),
|
||||
"Non-forced node has binding on destruction");
|
||||
|
||||
// if NODE_FORCE_XBL_BINDINGS is set, the node might still have a binding
|
||||
// attached
|
||||
if (aNode->HasFlag(NODE_FORCE_XBL_BINDINGS) &&
|
||||
ownerDoc && ownerDoc->BindingManager()) {
|
||||
ownerDoc->BindingManager()->ChangeDocumentFor(elem, ownerDoc, nsnull);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -972,7 +972,9 @@ nsXBLBinding::ExecuteAttachedHandler()
|
||||
if (mNextBinding)
|
||||
mNextBinding->ExecuteAttachedHandler();
|
||||
|
||||
if (AllowScripts())
|
||||
// Executing mNextBindings constructor might have caused us to loose our
|
||||
// bound element
|
||||
if (mBoundElement && AllowScripts())
|
||||
mPrototypeBinding->BindingAttached(mBoundElement);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user