Skip to content

Commit

Permalink
Disallow customElements.define being given named constructors
Browse files Browse the repository at this point in the history
#1411 disallowed passing in interface objects, but forgot named
constructors like Image, Audio, and Option. Noted during the review of
web-platform-tests/wpt#3308.
  • Loading branch information
domenic authored and annevk committed Jul 21, 2016
1 parent a10a3a8 commit f9c5830
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -66088,9 +66088,10 @@ dictionary <dfn>ElementDefinitionOptions</dfn> {
<code>TypeError</code> and abort these steps.</p></li>

<li>
<p>If <var>constructor</var> is an <span>interface object</span> whose corresponding
interface either is <code>HTMLElement</code> or has <code>HTMLElement</code> in its set of
<span>inherited interfaces</span>, throw a <code>TypeError</code> and abort these steps.</p>
<p>If <var>constructor</var> is either an <span>interface object</span> or <span>named
constructor</span>, whose corresponding interface either is <code>HTMLElement</code> or has
<code>HTMLElement</code> in its set of <span>inherited interfaces</span>, throw a
<code>TypeError</code> and abort these steps.</p>

<div class="note">
<p>This prevents passing, for example, <code class="no-backref">HTMLButtonElement</code> as
Expand Down

0 comments on commit f9c5830

Please sign in to comment.