Bug 1309147 - Part 4: Add CEReactions for CustomElementRegistry.

Tag UXP Issue #1344
This commit is contained in:
Gaming4JC 2020-01-04 10:32:21 -05:00 committed by Roy Tam
commit cc71e21e02
3 changed files with 2 additions and 10 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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);