Skip to content

Commit

Permalink
Define HTMLCollection's named properties better. Also widen the eleme…
Browse files Browse the repository at this point in the history
…nt-whitelist for name to include all elements in the HTML namespace.

Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=16571
  • Loading branch information
annevk committed Dec 14, 2012
1 parent 653152a commit 1400a64
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 30 deletions.
40 changes: 26 additions & 14 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -8238,20 +8238,32 @@ <h3>Interface <code>HTMLCollection</code></h3>
<span title=concept-element>element</span> in the <span title=concept-collection>collection</span>. If there is no
<var title>index</var>th <span title=concept-element>element</span> in the <span title=concept-collection>collection</span>, then the method must return null.

<p>The <span data-anolis-spec=webidl>supported property names</span> consist
of the <span title=concept-attribute-value>values</span> of the
<span title=concept-named-attribute><code title>name</code> attributes</span>
of each <code title>a</code>, <code title>applet</code>,
<code title>area</code>, <code title>embed</code>, <code title>form</code>,
<code title>frame</code>, <code title>frameset</code>,
<code title>iframe</code>, <code title>img</code>, and
<code title>object</code> element in the <span>HTML namespace</span>,
<span>represented by the collection</span> with a
<span title=concept-named-attribute><code title>name</code> attribute</span>,
and the <span title=concept-id>IDs</span> of the
<span title=concept-element>elements</span>
<span>represented by the collection</span>, intertwined in
<span title=concept-tree-order>tree order</span>.
<p>The <span data-anolis-spec=webidl>supported property names</span> are the
values from the list returned by these steps:

<ol>
<li><p>Let <var title>set</var> be an empty list.
<li>
<p>For each <var title>element</var>
<span>represented by the collection</span>, in
<span title=concept-tree-order>tree order</span>, run these substeps:
<ol>
<li><p>If <var title>element</var> is in the <span>HTML namespace</span>
and <span title=concept-element-attribute-has>has</span> a
<span title=concept-named-attribute><code title>name</code> attribute</span>
whose <span title=concept-attribute-value>value</span> is neither the
empty string nor is in <var title>set</var>, append
<var title>element</var>'s
<span title=concept-named-attribute><code title>name</code> attribute</span>
<span title=concept-attribute-value>value</span> to <var title>set</var>.

<li><p>If <var title>element</var> has an
<span title=concept-ID>ID</span> which is not in <var title>set</var>,
append <var title>element</var>'s <span title=concept-ID>ID</span> to
<var title>set</var>.
</ol>
<li><p>Return <var title>set</var>.
</ol>

<p>The
<dfn title=dom-HTMLCollection-namedItem><code>namedItem(<var title>key</var>)</code></dfn>
Expand Down
44 changes: 28 additions & 16 deletions dom-core.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<p><a class="logo" href="//www.whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-dom.svg" width="100"></a></p>
<h1>DOM</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-13-december-2012">Living Standard — Last Updated 13 December 2012</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-14-december-2012">Living Standard — Last Updated 14 December 2012</h2>

<dl>
<dt>This Version:
Expand Down Expand Up @@ -42,7 +42,7 @@ <h2 class="no-num no-toc" id="living-standard-—-last-updated-13-december-2012"
<p class="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license"><img alt="CC0" src="http://i.creativecommons.org/p/zero/1.0/80x15.png"></a>
To the extent possible under law, the editors have waived all copyright and
related or neighboring rights to this work. In addition, as of
13 December 2012, the editors have made this specification available
14 December 2012, the editors have made this specification available
under the
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at
Expand Down Expand Up @@ -8264,20 +8264,32 @@ <h3 id="interface-htmlcollection"><span class="secno">8.2 </span>Interface <code
<a href="#concept-element" title="concept-element">element</a> in the <a href="#concept-collection" title="concept-collection">collection</a>. If there is no
<var title="">index</var>th <a href="#concept-element" title="concept-element">element</a> in the <a href="#concept-collection" title="concept-collection">collection</a>, then the method must return null.

<p>The <a class="external" data-anolis-spec="webidl" href="http://dev.w3.org/2006/webapi/WebIDL/#dfn-supported-property-names">supported property names</a> consist
of the <a href="#concept-attribute-value" title="concept-attribute-value">values</a> of the
<a href="#concept-named-attribute" title="concept-named-attribute"><code title="">name</code> attributes</a>
of each <code title="">a</code>, <code title="">applet</code>,
<code title="">area</code>, <code title="">embed</code>, <code title="">form</code>,
<code title="">frame</code>, <code title="">frameset</code>,
<code title="">iframe</code>, <code title="">img</code>, and
<code title="">object</code> element in the <a href="#html-namespace">HTML namespace</a>,
<a href="#represented-by-the-collection">represented by the collection</a> with a
<a href="#concept-named-attribute" title="concept-named-attribute"><code title="">name</code> attribute</a>,
and the <a href="#concept-id" title="concept-id">IDs</a> of the
<a href="#concept-element" title="concept-element">elements</a>
<a href="#represented-by-the-collection">represented by the collection</a>, intertwined in
<a href="#concept-tree-order" title="concept-tree-order">tree order</a>.
<p>The <a class="external" data-anolis-spec="webidl" href="http://dev.w3.org/2006/webapi/WebIDL/#dfn-supported-property-names">supported property names</a> are the
values from the list returned by these steps:

<ol>
<li><p>Let <var title="">set</var> be an empty list.
<li>
<p>For each <var title="">element</var>
<a href="#represented-by-the-collection">represented by the collection</a>, in
<a href="#concept-tree-order" title="concept-tree-order">tree order</a>, run these substeps:
<ol>
<li><p>If <var title="">element</var> is in the <a href="#html-namespace">HTML namespace</a>
and <a href="#concept-element-attribute-has" title="concept-element-attribute-has">has</a> a
<a href="#concept-named-attribute" title="concept-named-attribute"><code title="">name</code> attribute</a>
whose <a href="#concept-attribute-value" title="concept-attribute-value">value</a> is neither the
empty string nor is in <var title="">set</var>, append
<var title="">element</var>'s
<a href="#concept-named-attribute" title="concept-named-attribute"><code title="">name</code> attribute</a>
<a href="#concept-attribute-value" title="concept-attribute-value">value</a> to <var title="">set</var>.

<li><p>If <var title="">element</var> has an
<a href="#concept-id" title="concept-ID">ID</a> which is not in <var title="">set</var>,
append <var title="">element</var>'s <a href="#concept-id" title="concept-ID">ID</a> to
<var title="">set</var>.
</ol>
<li><p>Return <var title="">set</var>.
</ol>

<p>The
<dfn id="dom-htmlcollection-nameditem" title="dom-HTMLCollection-namedItem"><code>namedItem(<var title="">key</var>)</code></dfn>
Expand Down

0 comments on commit 1400a64

Please sign in to comment.