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

> +
> +            <li>Let <var>result</var> be a new <a href="https://dom.spec.whatwg.org/#concept-element">element</a> that implements <var>interface</var>, with no attributes, <a href="https://dom.spec.whatwg.org/#concept-element-namespace">namespace</a> set to the <a href="https://dom.spec.whatwg.org/#html-namespace">HTML namespace</a>, <a href="https://dom.spec.whatwg.org/#concept-element-local-name">local name</a> set to <var>localName</var>, and <a href="https://dom.spec.whatwg.org/#concept-node-document">node document</a> set to the <a href="https://dom.spec.whatwg.org/#context-object">context object</a>.</li>
> +
> +            <li><a href="https://dom.spec.whatwg.org/#concept-element-attributes-set-value">Set the attribute value</a> for <var>result</var> using <code>is</code> and <var>type</var>.</li>
> +        </ol>
> +    </li>
> +
> +    <li>
> +        <p>Otherwise, if <var>registry</var> contains an entry with <a href="#dfn-element-definition-local-name">local name</a> <var>localName</var>:</p>
> +
> +        <ol>
> +            <li>Let <var>definition</var> be the entry in <var>registry</var> with <a href="#dfn-element-definition-local-name">local name</a> <var>localName</var>.</li>
> +
> +            <li>Let <var>C</var> be <var>definition</var>'s <a href="#dfn-element-definition-constructor">constructor</a>.</li>
> +
> +            <li>Return the result of <a href="https://tc39.github.io/ecma262/#sec-construct">Construct</a>(<var>C</var>), rethrowing any exceptions.</li>

We should check the return value of `Construct` call and throw or return `null` / `undefined` when it's not an `Element`.

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

Received on Wednesday, 2 March 2016 00:18:56 UTC