summaryrefslogtreecommitdiffstats
path: root/dom/base/nsContentUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r--dom/base/nsContentUtils.cpp34
1 files changed, 8 insertions, 26 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index b029f9793..76171dda0 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -9661,48 +9661,30 @@ nsContentUtils::EnqueueUpgradeReaction(Element* aElement,
MOZ_ASSERT(aElement);
nsIDocument* doc = aElement->OwnerDoc();
- nsPIDOMWindowInner* window(doc->GetInnerWindow());
- if (!window) {
- return;
- }
- RefPtr<CustomElementRegistry> registry(window->CustomElements());
- if (!registry) {
+ // No DocGroup means no custom element reactions stack.
+ if (!doc->GetDocGroup()) {
return;
}
CustomElementReactionsStack* stack =
doc->GetDocGroup()->CustomElementReactionsStack();
- stack->EnqueueUpgradeReaction(registry, aElement, aDefinition);
+ stack->EnqueueUpgradeReaction(aElement, aDefinition);
}
/* static */ void
-nsContentUtils::EnqueueLifecycleCallback(nsIDocument* aDoc,
- nsIDocument::ElementCallbackType aType,
+nsContentUtils::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
Element* aCustomElement,
LifecycleCallbackArgs* aArgs,
CustomElementDefinition* aDefinition)
{
- MOZ_ASSERT(aDoc);
-
- // To support imported document.
- nsCOMPtr<nsIDocument> doc = aDoc->MasterDocument();
-
- if (!doc->GetDocShell()) {
- return;
- }
-
- nsCOMPtr<nsPIDOMWindowInner> window(doc->GetInnerWindow());
- if (!window) {
- return;
- }
-
- RefPtr<CustomElementRegistry> registry(window->CustomElements());
- if (!registry) {
+ // No DocGroup means no custom element reactions stack.
+ if (!aCustomElement->OwnerDoc()->GetDocGroup()) {
return;
}
- registry->EnqueueLifecycleCallback(aType, aCustomElement, aArgs, aDefinition);
+ CustomElementRegistry::EnqueueLifecycleCallback(aType, aCustomElement, aArgs,
+ aDefinition);
}
/* static */ void