diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-01-05 12:51:10 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-01-26 15:50:27 -0500 |
commit | f50503df9c2eced785957626273ee07e5312d546 (patch) | |
tree | 3bc2c0f85b649507cc0c56700fa39f943180847e /dom/base/nsContentUtils.cpp | |
parent | 5840b63cca00a45c8c40bf5e04195aabd4dabb73 (diff) | |
download | uxp-f50503df9c2eced785957626273ee07e5312d546.tar.gz |
Bug 1301024 - Part 2: Implement create an element steps.
Tag UXP Issue #1344
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r-- | dom/base/nsContentUtils.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 570065dba5..f8964d198f 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -9660,6 +9660,28 @@ nsContentUtils::GetElementDefinitionIfObservingAttr(Element* aCustomElement, } /* 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, Element* aCustomElement, |