[html5] r6900 - [giow] (0) Update HTMLAllCollection.item(DOMString) to act like namedItem. Fixin [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Jan 17 15:02:52 PST 2012


Author: ianh
Date: 2012-01-17 15:02:50 -0800 (Tue, 17 Jan 2012)
New Revision: 6900

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Update HTMLAllCollection.item(DOMString) to act like namedItem.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=15184
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2012-01-17 22:13:48 UTC (rev 6899)
+++ complete.html	2012-01-17 23:02:50 UTC (rev 6900)
@@ -8841,10 +8841,13 @@
   <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>
@@ -8861,6 +8864,8 @@
     <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>
@@ -8886,7 +8891,7 @@
   <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>
@@ -8902,10 +8907,10 @@
      <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>
 

Modified: index
===================================================================
--- index	2012-01-17 22:13:48 UTC (rev 6899)
+++ index	2012-01-17 23:02:50 UTC (rev 6900)
@@ -8841,10 +8841,13 @@
   <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>
@@ -8861,6 +8864,8 @@
     <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>
@@ -8886,7 +8891,7 @@
   <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>
@@ -8902,10 +8907,10 @@
      <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>
 

Modified: source
===================================================================
--- source	2012-01-17 22:13:48 UTC (rev 6899)
+++ source	2012-01-17 23:02:50 UTC (rev 6900)
@@ -8855,10 +8855,15 @@
   <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>
@@ -8877,6 +8882,8 @@
     <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>
@@ -8906,8 +8913,10 @@
   <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>
@@ -8927,10 +8936,10 @@
      <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>
 




More information about the Commit-Watchers mailing list