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
This commit is contained in:
Emilio Cobos Álvarez 2018-03-29 17:42:01 +02:00
parent f004e39cd6
commit 3218d73ada

View File

@ -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));