Bug 1416999 - Remove document.registerElement

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 07:07:09 -04:00 committed by Roy Tam
commit cedff6e214
28 changed files with 82 additions and 879 deletions

View file

@ -414,19 +414,6 @@ CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType
reactionsStack->EnqueueCallbackReaction(aCustomElement, Move(callback));
}
void
CustomElementRegistry::GetCustomPrototype(nsIAtom* aAtom,
JS::MutableHandle<JSObject*> aPrototype)
{
mozilla::dom::CustomElementDefinition* definition =
mCustomDefinitions.GetWeak(aAtom);
if (definition) {
aPrototype.set(definition->mPrototype);
} else {
aPrototype.set(nullptr);
}
}
void
CustomElementRegistry::UpgradeCandidates(nsIAtom* aKey,
CustomElementDefinition* aDefinition,
@ -624,9 +611,9 @@ CustomElementRegistry::Define(const nsAString& aName,
*/
JSAutoCompartment ac(cx, constructor);
JS::Rooted<JS::Value> prototypev(cx);
// The .prototype on the constructor passed from document.registerElement
// is the "expando" of a wrapper. So we should get it from wrapper instead
// instead of underlying object.
// The .prototype on the constructor passed could be an "expando" of a
// wrapper. So we should get it from wrapper instead of the underlying
// object.
if (!JS_GetProperty(cx, constructor, "prototype", &prototypev)) {
aRv.StealExceptionFromJSContext(cx);
return;