From e0557470385b6f7c1ab8e277b2b72a5146856fe6 Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Sat, 4 Jan 2020 10:32:21 -0500 Subject: Bug 1309147 - Part 4: Add CEReactions for CustomElementRegistry. Tag UXP Issue #1344 --- dom/base/CustomElementRegistry.cpp | 9 --------- dom/base/nsDocument.cpp | 1 + dom/webidl/CustomElementRegistry.webidl | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index d8ca7ade2..b50a1345e 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -547,15 +547,6 @@ CustomElementRegistry::Define(const nsAString& aName, const ElementDefinitionOptions& aOptions, ErrorResult& aRv) { - // We do this for [CEReaction] temporarily and it will be removed - // after webidl supports [CEReaction] annotation in bug 1309147. - DocGroup* docGroup = mWindow->GetDocGroup(); - if (!docGroup) { - aRv.Throw(NS_ERROR_UNEXPECTED); - return; - } - - AutoCEReaction ceReaction(docGroup->CustomElementReactionsStack()); aRv.MightThrowJSException(); AutoJSAPI jsapi; diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 3faa39ab3..dc12d8fb1 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -5770,6 +5770,7 @@ nsDocument::RegisterElement(JSContext* aCx, const nsAString& aType, return; } + AutoCEReaction ceReaction(this->GetDocGroup()->CustomElementReactionsStack()); // Unconditionally convert TYPE to lowercase. nsAutoString lcType; nsContentUtils::ASCIIToLower(aType, lcType); diff --git a/dom/webidl/CustomElementRegistry.webidl b/dom/webidl/CustomElementRegistry.webidl index dff612174..788b6a4ed 100644 --- a/dom/webidl/CustomElementRegistry.webidl +++ b/dom/webidl/CustomElementRegistry.webidl @@ -5,7 +5,7 @@ // https://html.spec.whatwg.org/#dom-window-customelements [Func="CustomElementRegistry::IsCustomElementEnabled"] interface CustomElementRegistry { - [Throws] + [CEReactions, Throws] void define(DOMString name, Function functionConstructor, optional ElementDefinitionOptions options); any get(DOMString name); -- cgit v1.2.3