From 839b3e4df88998585d029cdfbc3dee5c6514efcd Mon Sep 17 00:00:00 2001 From: Gabor Krizsanits Date: Thu, 28 Aug 2014 13:53:21 +0200 Subject: [PATCH] Bug 1056841 - Always nulling mContainingShadow in Element::UnbindFromTree. r=wchen --- content/base/src/Element.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/content/base/src/Element.cpp b/content/base/src/Element.cpp index f0724dff55af..dc60324705a8 100644 --- a/content/base/src/Element.cpp +++ b/content/base/src/Element.cpp @@ -1500,20 +1500,22 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent) // Unset this since that's what the old code effectively did. UnsetFlags(NODE_FORCE_XBL_BINDINGS); - + bool clearBindingParent = true; + #ifdef MOZ_XUL nsXULElement* xulElem = nsXULElement::FromContent(this); if (xulElem) { xulElem->SetXULBindingParent(nullptr); + clearBindingParent = false; } - else #endif - { - nsDOMSlots *slots = GetExistingDOMSlots(); - if (slots) { + + nsDOMSlots* slots = GetExistingDOMSlots(); + if (slots) { + if (clearBindingParent) { slots->mBindingParent = nullptr; - slots->mContainingShadow = nullptr; } + slots->mContainingShadow = nullptr; } // This has to be here, rather than in nsGenericHTMLElement::UnbindFromTree,