diff --git a/source b/source index 466c8590e0a..1ea1d933c75 100644 --- a/source +++ b/source @@ -2999,6 +2999,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
If definition's local + name is equal to definition's name (i.e., definition is for + an autonomous custom element), then:
+ +If the currently-executing constructor is not HTMLElement
, then throw a
+ TypeError
and abort these steps.
This can occur when a custom element is defined to not extend any local names, but
+ inherits from a non-HTMLElement
class:
customElements.define("bad-1", class Bad1 extends HTMLParagraphElement {});+ +
In this case, during the (implicit) super()
call that occurs when
+ constructing an instance of Bad1
, the currently-executing constructor
+ is HTMLParagraphElement
, not HTMLElement
.
Otherwise (i.e., if definition is for a customized built-in + element):
+ +Let valid local names be the list of local names for elements defined in this + specification or in other applicable specifications that use the active + function object as their element interface.
If valid local names does not contain definition's local name, then throw a
+ TypeError
and abort these steps.
This can occur when a custom element is defined to extend a given local name but inherits + from the wrong class:
+ +customElements.define("bad-2", class Bad2 extends HTMLQuoteElement {}, { extends: "p" });+ +
In this case, during the (implicit) super()
call that occurs when
+ constructing an instance of Bad2
, valid local names is the
+ list containing q
and blockquote
, but definition's local name is p
,
+ which is not in that list.
Let prototype be definition's prototype.