From 3218d73ada7e13612578de9e3fd4e8acb0ca0ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 29 Mar 2018 17:42:01 +0200 Subject: [PATCH] Bug 1441136: Some other minor cleanup. r=smaug Now that XBL and Shadow DOM are not entangled we don't really need to do this. MozReview-Commit-ID: GdgnE5QT2NR --- dom/base/Element.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index c73013a5e84b..fd06eb0ee3c3 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1703,10 +1703,9 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent, UpdateEditableState(false); - // If we had a pre-existing XBL binding, - // we might have anonymous children that also need to be told that they are - // moving. - if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR) && !GetShadowRoot()) { + // If we had a pre-existing XBL binding, we might have anonymous children that + // also need to be told that they are moving. + if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) { nsXBLBinding* binding = OwnerDoc()->BindingManager()->GetBindingWithContent(this); @@ -1768,8 +1767,7 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent, } // Call BindToTree on shadow root children. - ShadowRoot* shadowRoot = GetShadowRoot(); - if (shadowRoot) { + if (ShadowRoot* shadowRoot = GetShadowRoot()) { shadowRoot->SetIsComposedDocParticipant(IsInComposedDoc()); for (nsIContent* child = shadowRoot->GetFirstChild(); child; child = child->GetNextSibling()) { @@ -1989,11 +1987,9 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent) } if (document) { - // Notify XBL- & nsIAnonymousContentCreator-generated - // anonymous content that the document is changing. - // Unlike XBL, bindings for web components shadow DOM - // do not get uninstalled. - if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR) && !GetShadowRoot()) { + if (HasFlag(NODE_MAY_BE_IN_BINDING_MNGR)) { + // Notify XBL- & nsIAnonymousContentCreator-generated anonymous content + // that the document is changing. nsContentUtils::AddScriptRunner( new RemoveFromBindingManagerRunnable( document->BindingManager(), this, document));