Skip to content

Commit

Permalink
[giow] (0) Update HTMLAllCollection.item(DOMString) to act like named…
Browse files Browse the repository at this point in the history
…Item.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=15184
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@6900 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 17, 2012
1 parent f334c77 commit ec9d58c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
15 changes: 10 additions & 5 deletions complete.html
Expand Up @@ -8841,10 +8841,13 @@ <h5 id=htmlallcollection-0><span class=secno>2.8.2.1 </span>HTMLAllCollection</h
<a href=#collections title=collections>collection</a> of elements just like
<code><a href=#htmlcollection>HTMLCollection</a></code>, with the exception that its <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem()</a></code> method
returns an <code><a href=#htmlallcollection>HTMLAllCollection</a></code> object when there are
multiple matching elements.</p>
multiple matching elements, and that its <code title=dom-HTMLAllCollection-item>item()</code> method can be used
as a synonym for its <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem()</a></code>
method.</p>

<pre class=idl>interface <dfn id=htmlallcollection>HTMLAllCollection</dfn> : <a href=#htmlcollection>HTMLCollection</a> {
// inherits <span title=dom-HTMLCollection-length>length</span> and <span title=dom-HTMLCollection-item>item</span>()
// inherits <span title=dom-HTMLCollection-length>length</span> and <span title=dom-HTMLCollection-item>item</span>(unsigned long index)
object? <a href=#dom-htmlallcollection-item-string title=dom-HTMLAllCollection-item-string>item</a>(DOMString name);
legacycaller getter object? <a href=#dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem>namedItem</a>(DOMString name); // overrides inherited namedItem()
<a href=#htmlallcollection>HTMLAllCollection</a> <a href=#dom-htmlallcollection-tags title=dom-HTMLAllCollection-tags>tags</a>(DOMString tagName);
};</pre>
Expand All @@ -8861,6 +8864,8 @@ <h5 id=htmlallcollection-0><span class=secno>2.8.2.1 </span>HTMLAllCollection</h
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <a href=#tree-order>tree order</a>.</p>
</dd>

<dt><var title="">element</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-item-string><a href=#dom-htmlallcollection-item-string>item</a></code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-item-string><a href=#dom-htmlallcollection-item-string>item</a></code>(<var title="">name</var>)</dt>
<dt><var title="">element</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem</a></code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem</a></code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
Expand All @@ -8886,7 +8891,7 @@ <h5 id=htmlallcollection-0><span class=secno>2.8.2.1 </span>HTMLAllCollection</h
<a href=#supported-property-names>supported property names</a> are as defined for
<code><a href=#htmlcollection>HTMLCollection</a></code> objects.</p>

<p>The <dfn id=dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem><code>namedItem(<var title="">key</var>)</code></dfn> method must act according to the
<p>The <dfn id=dom-htmlallcollection-item-string title=dom-HTMLAllCollection-item-string><code>item(<var title="">name</var>)</code></dfn> and <dfn id=dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem><code>namedItem(<var title="">name</var>)</code></dfn> methods must act according to the
following algorithm:</p>

<ol><li>
Expand All @@ -8902,10 +8907,10 @@ <h5 id=htmlallcollection-0><span class=secno>2.8.2.1 </span>HTMLAllCollection</h
<code><a href=#the-embed-element>embed</a></code>, <code><a href=#the-form-element>form</a></code>, <code><a href=#frame>frame</a></code>,
<code><a href=#frameset>frameset</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, or
<code><a href=#the-object-element>object</a></code> elements with a <code title="">name</code>
attribute equal to <var title="">key</var>, or,</li>
attribute equal to <var title="">name</var>, or,</li>

<li>elements with an <a href=#concept-id title=concept-id>ID</a> equal to
<var title="">key</var>.</li>
<var title="">name</var>.</li>

</ul></li>

Expand Down
15 changes: 10 additions & 5 deletions index
Expand Up @@ -8841,10 +8841,13 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<a href=#collections title=collections>collection</a> of elements just like
<code><a href=#htmlcollection>HTMLCollection</a></code>, with the exception that its <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem()</a></code> method
returns an <code><a href=#htmlallcollection>HTMLAllCollection</a></code> object when there are
multiple matching elements.</p>
multiple matching elements, and that its <code title=dom-HTMLAllCollection-item>item()</code> method can be used
as a synonym for its <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem()</a></code>
method.</p>

<pre class=idl>interface <dfn id=htmlallcollection>HTMLAllCollection</dfn> : <a href=#htmlcollection>HTMLCollection</a> {
// inherits <span title=dom-HTMLCollection-length>length</span> and <span title=dom-HTMLCollection-item>item</span>()
// inherits <span title=dom-HTMLCollection-length>length</span> and <span title=dom-HTMLCollection-item>item</span>(unsigned long index)
object? <a href=#dom-htmlallcollection-item-string title=dom-HTMLAllCollection-item-string>item</a>(DOMString name);
legacycaller getter object? <a href=#dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem>namedItem</a>(DOMString name); // overrides inherited namedItem()
<a href=#htmlallcollection>HTMLAllCollection</a> <a href=#dom-htmlallcollection-tags title=dom-HTMLAllCollection-tags>tags</a>(DOMString tagName);
};</pre>
Expand All @@ -8861,6 +8864,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <a href=#tree-order>tree order</a>.</p>
</dd>

<dt><var title="">element</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-item-string><a href=#dom-htmlallcollection-item-string>item</a></code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-item-string><a href=#dom-htmlallcollection-item-string>item</a></code>(<var title="">name</var>)</dt>
<dt><var title="">element</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem</a></code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var> = <var title="">collection</var> . <code title=dom-HTMLAllCollection-namedItem><a href=#dom-htmlallcollection-nameditem>namedItem</a></code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
Expand All @@ -8886,7 +8891,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<a href=#supported-property-names>supported property names</a> are as defined for
<code><a href=#htmlcollection>HTMLCollection</a></code> objects.</p>

<p>The <dfn id=dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem><code>namedItem(<var title="">key</var>)</code></dfn> method must act according to the
<p>The <dfn id=dom-htmlallcollection-item-string title=dom-HTMLAllCollection-item-string><code>item(<var title="">name</var>)</code></dfn> and <dfn id=dom-htmlallcollection-nameditem title=dom-HTMLAllCollection-namedItem><code>namedItem(<var title="">name</var>)</code></dfn> methods must act according to the
following algorithm:</p>

<ol><li>
Expand All @@ -8902,10 +8907,10 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<code><a href=#the-embed-element>embed</a></code>, <code><a href=#the-form-element>form</a></code>, <code><a href=#frame>frame</a></code>,
<code><a href=#frameset>frameset</a></code>, <code><a href=#the-iframe-element>iframe</a></code>, <code><a href=#the-img-element>img</a></code>, or
<code><a href=#the-object-element>object</a></code> elements with a <code title="">name</code>
attribute equal to <var title="">key</var>, or,</li>
attribute equal to <var title="">name</var>, or,</li>

<li>elements with an <a href=#concept-id title=concept-id>ID</a> equal to
<var title="">key</var>.</li>
<var title="">name</var>.</li>

</ul></li>

Expand Down
19 changes: 14 additions & 5 deletions source
Expand Up @@ -8855,10 +8855,15 @@ is conforming depends on which specs apply, and leaves it at that. -->
<code>HTMLCollection</code>, with the exception that its <code
title="dom-HTMLAllCollection-namedItem">namedItem()</code> method
returns an <code>HTMLAllCollection</code> object when there are
multiple matching elements.</p>
multiple matching elements, and that its <code
title="dom-HTMLAllCollection-item">item()</code> method can be used
as a synonym for its <code
title="dom-HTMLAllCollection-namedItem">namedItem()</code>
method.</p>

<pre class="idl">interface <dfn>HTMLAllCollection</dfn> : <span>HTMLCollection</span> {
// inherits <span title="dom-HTMLCollection-length">length</span> and <span title="dom-HTMLCollection-item">item</span>()
// inherits <span title="dom-HTMLCollection-length">length</span> and <span title="dom-HTMLCollection-item">item</span>(unsigned long index)
object? <span title="dom-HTMLAllCollection-item-string">item</span>(DOMString name);
legacycaller getter object? <span title="dom-HTMLAllCollection-namedItem">namedItem</span>(DOMString name); // overrides inherited namedItem()
<span>HTMLAllCollection</span> <span title="dom-HTMLAllCollection-tags">tags</span>(DOMString tagName);
};</pre>
Expand All @@ -8877,6 +8882,8 @@ is conforming depends on which specs apply, and leaves it at that. -->
<p>Returns the item with index <var title="">index</var> from the collection. The items are sorted in <span>tree order</span>.</p>
</dd>

<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-item-string">item</code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-item-string">item</code>(<var title="">name</var>)</dt>
<dt><var title="">element</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-namedItem">namedItem</code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var> = <var title="">collection</var> . <code title="dom-HTMLAllCollection-namedItem">namedItem</code>(<var title="">name</var>)</dt>
<dt><var title="">collection</var>[<var title="">name</var>]</dt>
Expand Down Expand Up @@ -8906,8 +8913,10 @@ is conforming depends on which specs apply, and leaves it at that. -->
<code>HTMLCollection</code> objects.</p>

<p>The <dfn
title="dom-HTMLAllCollection-item-string"><code>item(<var
title="">name</var>)</code></dfn> and <dfn
title="dom-HTMLAllCollection-namedItem"><code>namedItem(<var
title="">key</var>)</code></dfn> method must act according to the
title="">name</var>)</code></dfn> methods must act according to the
following algorithm:</p>

<ol>
Expand All @@ -8927,10 +8936,10 @@ is conforming depends on which specs apply, and leaves it at that. -->
<code>embed</code>, <code>form</code>, <code>frame</code>,
<code>frameset</code>, <code>iframe</code>, <code>img</code>, or
<code>object</code> elements with a <code title="">name</code>
attribute equal to <var title="">key</var>, or,</li>
attribute equal to <var title="">name</var>, or,</li>

<li>elements with an <span title="concept-id">ID</span> equal to
<var title="">key</var>.</li>
<var title="">name</var>.</li>

</ul>

Expand Down

0 comments on commit ec9d58c

Please sign in to comment.