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

> -        <li><a data-lt="enqueue a lifecycle callback">Enqueue</a> <a data-lt="createdCallback">created</a> callback for <var>ELEMENT</var></li>
> -        <li>Return <var>ELEMENT</var>.</li>
> -    </ol></li>
> +<section id="htmlelement-constructor">
> +<h3>The <a href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement"><code>HTMLElement</code></a> Constructor</h3>
> +
> +The <a href="https://html.spec.whatwg.org/multipage/dom.html#htmlelement"><code>HTMLElement</code></a> interface gains following annotation:
> +
> +<pre>
> +[Constructor]
> +</pre>
> +
> +The <dfn id="dom-htmlelement-constructor"><code>HTMLElement</code> constructor</dfn>, when invoked, must perform the following steps:
> +
> +<ol>
> +    <li>Let <var>document</var> be the <a href="https://html.spec.whatwg.org/multipage/#concept-document-window">associated document</a> of <a href="https://html.spec.whatwg.org/#the-current-realm-record">the current Realm Record</a>'s [[\GlobalObject]].</li>

As we discussed on IRC, I don't think this is quite right in the case a custom element extends another document's prototype (e.g. to have its own registry).  We should be using the global object of `[[Prototype]]` internal slot of the constructor or the global object of the realm of the `HTMLElement` constructor itself.

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

Received on Wednesday, 2 March 2016 00:06:38 UTC