Re: [whatwg/dom] Editorial: use IDL to simplify create an element (#751)

domenic approved this pull request.

I see, IDL's "constructing" checks this after the changes in https://github.com/whatwg/html/pull/4525. So, let's not merge this until that happens, but LGTM in general.

> -      <code>TypeError</code>.
-
-      <div class=note>
-       <p>This is meant to be a brand check to ensure that the object was allocated by the HTML
-       element constructor. See <a href="https://github.com/heycam/webidl/issues/97">webidl #97</a>
-       about making this more precise.
-
-       <p>If this check passes, then <var>result</var> will already have its
-       <a for=Element>custom element state</a> and <a for=Element>custom element definition</a>
-       initialized.
-      </div>
-     </li>
+     <li><p>Assert: <var>result</var>'s <a for=Element>custom element state</a> and
+     <a for=Element>custom element definition</a> are initialized.
+
+     <li><p>Assert: <var>result</var>'s <a for=Element>namespace</a> is the <a>HTML namespace</a>.

I think it's still worth keeping a note why this assert is true: it's because IDL enforced that _result_ is a HTMLElement instance, and at this point in time all HTMLElement instances have the HTML namespace.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/751#pullrequestreview-226262906

Received on Friday, 12 April 2019 20:00:13 UTC