summaryrefslogtreecommitdiffstats
path: root/dom/base/Element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/Element.cpp')
-rw-r--r--dom/base/Element.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp
index 7ab0699ed..bfa0869c3 100644
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -1684,13 +1684,11 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
SetSubtreeRootPointer(aParent->SubtreeRoot());
}
- nsIDocument* composedDoc = GetComposedDoc();
- if (CustomElementRegistry::IsCustomElementEnabled() && composedDoc) {
+ if (CustomElementRegistry::IsCustomElementEnabled() && IsInComposedDoc()) {
// Connected callback must be enqueued whenever a custom element becomes
// connected.
if (GetCustomElementData()) {
- nsContentUtils::EnqueueLifecycleCallback(
- composedDoc, nsIDocument::eConnected, this);
+ nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eConnected, this);
}
}
@@ -1989,8 +1987,7 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
// the document and this document has a browsing context.
if (GetCustomElementData() && document->GetDocShell()) {
// Enqueue a detached callback for the custom element.
- nsContentUtils::EnqueueLifecycleCallback(
- document, nsIDocument::eDetached, this);
+ nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eDetached, this);
}
}
@@ -2605,7 +2602,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
};
nsContentUtils::EnqueueLifecycleCallback(
- OwnerDoc(), nsIDocument::eAttributeChanged, this, &args, definition);
+ nsIDocument::eAttributeChanged, this, &args, definition);
}
}
}
@@ -2870,7 +2867,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
};
nsContentUtils::EnqueueLifecycleCallback(
- OwnerDoc(), nsIDocument::eAttributeChanged, this, &args, definition);
+ nsIDocument::eAttributeChanged, this, &args, definition);
}
}
}