Re: [webcomponents] Large custom element spec rewrite to implement some F2F decisions (#405)

> +
> +    <li>Let <var>extends</var> be the value of the <code>extends</code> member of <var>options</var>.</li>
> +
> +    <li>
> +        <p>If <var>extends</var> is not null:</p>
> +
> +        <ol>
> +            <li>If the <a href="https://dom.spec.whatwg.org/#context-object">context object</a> is an <a href="https://dom.spec.whatwg.org/#html-document">HTML document</a>, let <var>extends</var> be <a href="https://dom.spec.whatwg.org/#converted-to-ascii-lowercase">converted to ASCII lowercase</a>.</li>
> +
> +            <li>If there is no <a href="https://dom.spec.whatwg.org/#concept-element-interface">element interface</a> for <var>extends</var> and the <a href="https://dom.spec.whatwg.org/#html-namespace">HTML namespace</a>, <a href="https://heycam.github.io/webidl/#dfn-throw">throw</a> a <code>NotSupportedError</code> and abort these steps.</li>
> +
> +            <li>Set <var>localName</var> to <var>extends</var>.</li>
> +        </ol>
> +    </li>
> +
> +    <li>Let <var>prototype</var> be <a href="https://tc39.github.io/ecma262/#sec-get-o-p">Get</a>(<var>constructor</var>, "prototype"). Rethrow any exceptions.</li>

I also think it's valuable to check that the [[Prototype]] internal slot of `constructor` is HTMLElement (or inherits from HTMLElement when `extends` is specified) as an early error although the author can modify __proto__ after the fact so it might be sufficient to check when the element gets constructed.

Anyway, this change can probably be made separately.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/pull/405/files#r54657347

Received on Tuesday, 1 March 2016 23:55:27 UTC