Bug 1301024 - Part 2: Implement create an element steps.

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-05 12:51:10 -05:00 committed by Roy Tam
commit b0285ef3f7
5 changed files with 129 additions and 5 deletions

View file

@ -9659,6 +9659,28 @@ nsContentUtils::GetElementDefinitionIfObservingAttr(Element* aCustomElement,
return definition;
}
/* static */ void
nsContentUtils::EnqueueUpgradeReaction(Element* aElement,
CustomElementDefinition* aDefinition)
{
MOZ_ASSERT(aElement);
nsIDocument* doc = aElement->OwnerDoc();
nsPIDOMWindowInner* window(doc->GetInnerWindow());
if (!window) {
return;
}
RefPtr<CustomElementRegistry> registry(window->CustomElements());
if (!registry) {
return;
}
CustomElementReactionsStack* stack =
doc->GetDocGroup()->CustomElementReactionsStack();
stack->EnqueueUpgradeReaction(registry, aElement, aDefinition);
}
/* static */ void
nsContentUtils::EnqueueLifecycleCallback(nsIDocument* aDoc,
nsIDocument::ElementCallbackType aType,