[html5] r6331 - [e] (0) Move getElementsByClassName() to DOM Core.

whatwg at whatwg.org whatwg at whatwg.org
Wed Jul 27 16:04:06 PDT 2011


Author: ianh
Date: 2011-07-27 16:04:04 -0700 (Wed, 27 Jul 2011)
New Revision: 6331

Modified:
   complete.html
   index
   source
Log:
[e] (0) Move getElementsByClassName() to DOM Core.

Modified: complete.html
===================================================================
--- complete.html	2011-07-27 20:37:32 UTC (rev 6330)
+++ complete.html	2011-07-27 23:04:04 UTC (rev 6331)
@@ -8876,7 +8876,6 @@
   readonly attribute <a href=#htmlcollection>HTMLCollection</a> <a href=#dom-document-forms title=dom-document-forms>forms</a>;
   readonly attribute <a href=#htmlcollection>HTMLCollection</a> <a href=#dom-document-scripts title=dom-document-scripts>scripts</a>;
   NodeList <a href=#dom-document-getelementsbyname title=dom-document-getElementsByName>getElementsByName</a>(in DOMString elementName);
-  NodeList <a href=#dom-document-getelementsbyclassname title=dom-document-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
 <!--MD-->  NodeList <a href=#dom-document-getitems title=dom-document-getItems>getItems</a>(in optional DOMString typeNames); // <a href=#microdata>microdata</a> <!--WARNING: ALSO DUPLICATED IN MICRODATA SECTION--><!--MD-->
 <!--CSSREF-->  readonly attribute <a href=#domelementmap>DOMElementMap</a> <a href=#dom-document-csselementmap title=dom-document-cssElementMap>cssElementMap</a>;<!--CSSREF-->
 
@@ -9387,16 +9386,6 @@
     attribute with the value <var title="">name</var>.</p>
    </dd>
 
-   <dt><var title="">collection</var> = <var title="">document</var> . <code title=dom-document-getElementsByClassName><a href=#dom-document-getelementsbyclassname>getElementsByClassName(<var title="">classes</var>)</a></code></dt>
-   <dt><var title="">collection</var> = <var title="">element</var> . <code title=dom-getElementsByClassName><a href=#dom-getelementsbyclassname>getElementsByClassName(<var title="">classes</var>)</a></code></dt>
-   <dd>
-    <p>Returns a <code><a href=#nodelist>NodeList</a></code> of the elements in the object
-    on which the method was invoked (a <code><a href=#document>Document</a></code> or an
-    <code><a href=#element>Element</a></code>) that have all the classes given by <var title="">classes</var>.</p>
-    <p>The <var title="">classes</var> argument is interpreted as a
-    space-separated list of classes.</p>
-   </dd>
-
   </dl><div class=impl>
 
   <p>The <dfn id=dom-document-getelementsbyname title=dom-document-getElementsByName><code>getElementsByName(<var title="">name</var>)</code></dfn> method takes a string <var title="">name</var>, and must return a <a href=#live>live</a>
@@ -9409,72 +9398,8 @@
   object returned by the earlier call. In other cases, a new
   <code><a href=#nodelist>NodeList</a></code> object must be returned.</p>
 
-  <p>The <dfn id=dom-document-getelementsbyclassname title=dom-document-getElementsByClassName><code>getElementsByClassName(<var title="">classNames</var>)</code></dfn> method takes a string that
-  contains a <a href=#set-of-space-separated-tokens>set of space-separated tokens</a> representing
-  classes. When called, the method must return a <a href=#live>live</a>
-  <code><a href=#nodelist>NodeList</a></code> object containing all the elements in the
-  document, in <a href=#tree-order>tree order</a>, that have all the classes
-  specified in that argument, having obtained the classes by <a href=#split-a-string-on-spaces title="split a string on spaces">splitting a string on
-  spaces</a>. (Duplicates are ignored.) If there are no tokens
-  specified in the argument, then the method must return an empty
-  <code><a href=#nodelist>NodeList</a></code>. If the document is in <a href=#quirks-mode>quirks
-  mode</a>, then the comparisons for the classes must be done in an
-  <a href=#ascii-case-insensitive>ASCII case-insensitive</a> manner, otherwise, the
-  comparisons must be done in a <a href=#case-sensitive>case-sensitive</a> manner.
-  When the method is invoked on a <code><a href=#document>Document</a></code> object again
-  with the same argument, the user agent may return the same object as
-  the object returned by the earlier call. In other cases, a new
-  <code><a href=#nodelist>NodeList</a></code> object must be returned.</p>
-
-  <p>The <dfn id=dom-getelementsbyclassname title=dom-getElementsByClassName><code>getElementsByClassName(<var title="">classNames</var>)</code></dfn> method on the
-  <code><a href=#htmlelement>HTMLElement</a></code> interface must return a <a href=#live>live</a>
-  <code><a href=#nodelist>NodeList</a></code> with the nodes that the
-  <code><a href=#htmldocument>HTMLDocument</a></code> <code title=dom-document-getElementsByClassName><a href=#dom-document-getelementsbyclassname>getElementsByClassName()</a></code>
-  method would return when passed the same argument(s), excluding any
-  elements that are not descendants of the <code><a href=#htmlelement>HTMLElement</a></code>
-  object on which the method was invoked.
-  When the method is invoked on an <code><a href=#htmlelement>HTMLElement</a></code> object
-  again with the same argument, the user agent may return the same
-  object as the object returned by the earlier call. In other cases, a
-  new <code><a href=#nodelist>NodeList</a></code> object must be returned.</p>
-
   </div>
 
-  <p>HTML, SVG, and MathML elements define which classes they are in
-  by having an attribute with no namespace with the name <code title="">class</code> containing a space-separated list of classes
-  to which the element belongs. Other specifications may also allow
-  elements in their namespaces to be labeled as being in specific
-  classes.</p>
-
-  <div class=example>
-
-   <p>Given the following XHTML fragment:</p>
-
-   <pre><div id="example">
- <p id="p1" class="aaa bbb"/>
- <p id="p2" class="aaa ccc"/>
- <p id="p3" class="bbb ccc"/>
-</div></pre>
-
-   <p>A call to <code title="">document.getElementById('example').getElementsByClassName('aaa')</code>
-   would return a <code><a href=#nodelist>NodeList</a></code> with the two paragraphs <code title="">p1</code> and <code title="">p2</code> in it.</p>
-
-   <p>A call to <code title="">getElementsByClassName('ccc bbb')</code> would only
-   return one node, however, namely <code title="">p3</code>. A call
-   to <code title="">document.getElementById('example').getElementsByClassName('bbb  ccc ')</code>
-   would return the same thing.</p>
-
-   <p>A call to <code title="">getElementsByClassName('aaa,bbb')</code> would return no
-   nodes; none of the elements above are in the "aaa,bbb" class.</p>
-
-  </div>
-
-<!-- v2:
->         * xGetParentElementByClassName(rootElement, className, tagName) -
-> Navigates upwards until we hit a parent element with the given class name and
-> optional tag name.
--->
-
 <!--CSSREF-->
   <hr><dl class=domintro><dt><var title="">element</var> . <code title=dom-document-cssElementMap><a href=#dom-document-csselementmap>cssElementMap</a></code></dt>
    <dd>
@@ -9963,9 +9888,6 @@
   requirements,</span> is the <code><a href=#htmlelement>HTMLElement</a></code> interface.</p>
 
   <pre class=idl>interface <dfn id=htmlelement>HTMLElement</dfn> : <a href=#element>Element</a> {
-  // <a href=#dom-tree-accessors>DOM tree accessors</a>
-  NodeList <a href=#dom-getelementsbyclassname title=dom-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
-
   // <a href=#dynamic-markup-insertion>dynamic markup insertion</a>
            attribute DOMString <a href=#dom-innerhtml title=dom-innerHTML>innerHTML</a>;
            attribute DOMString <a href=#dom-outerhtml title=dom-outerHTML>outerHTML</a>;
@@ -10655,7 +10577,7 @@
   </div>
 
   <p class=note>Assigning classes to an element affects class
-  matching in selectors in CSS, the <code title=dom-document-getElementsByClassName><a href=#dom-document-getelementsbyclassname>getElementsByClassName()</a></code>
+  matching in selectors in CSS, the <code title=dom-document-getElementsByClassName>getElementsByClassName()</code>
   method in the DOM, and other such features.</p>
 
   <p>There are no additional restrictions on the tokens authors can

Modified: index
===================================================================
--- index	2011-07-27 20:37:32 UTC (rev 6330)
+++ index	2011-07-27 23:04:04 UTC (rev 6331)
@@ -243,7 +243,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 26 July 2011</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 27 July 2011</h2>
    </hgroup><dl><dt><strong>Web developer edition</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -8745,7 +8745,6 @@
   readonly attribute <a href=#htmlcollection>HTMLCollection</a> <a href=#dom-document-forms title=dom-document-forms>forms</a>;
   readonly attribute <a href=#htmlcollection>HTMLCollection</a> <a href=#dom-document-scripts title=dom-document-scripts>scripts</a>;
   NodeList <a href=#dom-document-getelementsbyname title=dom-document-getElementsByName>getElementsByName</a>(in DOMString elementName);
-  NodeList <a href=#dom-document-getelementsbyclassname title=dom-document-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
 <!--MD-->  NodeList <a href=#dom-document-getitems title=dom-document-getItems>getItems</a>(in optional DOMString typeNames); // <a href=#microdata>microdata</a> <!--WARNING: ALSO DUPLICATED IN MICRODATA SECTION--><!--MD-->
 <!--CSSREF-->  readonly attribute <a href=#domelementmap>DOMElementMap</a> <a href=#dom-document-csselementmap title=dom-document-cssElementMap>cssElementMap</a>;<!--CSSREF-->
 
@@ -9256,16 +9255,6 @@
     attribute with the value <var title="">name</var>.</p>
    </dd>
 
-   <dt><var title="">collection</var> = <var title="">document</var> . <code title=dom-document-getElementsByClassName><a href=#dom-document-getelementsbyclassname>getElementsByClassName(<var title="">classes</var>)</a></code></dt>
-   <dt><var title="">collection</var> = <var title="">element</var> . <code title=dom-getElementsByClassName><a href=#dom-getelementsbyclassname>getElementsByClassName(<var title="">classes</var>)</a></code></dt>
-   <dd>
-    <p>Returns a <code><a href=#nodelist>NodeList</a></code> of the elements in the object
-    on which the method was invoked (a <code><a href=#document>Document</a></code> or an
-    <code><a href=#element>Element</a></code>) that have all the classes given by <var title="">classes</var>.</p>
-    <p>The <var title="">classes</var> argument is interpreted as a
-    space-separated list of classes.</p>
-   </dd>
-
   </dl><div class=impl>
 
   <p>The <dfn id=dom-document-getelementsbyname title=dom-document-getElementsByName><code>getElementsByName(<var title="">name</var>)</code></dfn> method takes a string <var title="">name</var>, and must return a <a href=#live>live</a>
@@ -9278,72 +9267,8 @@
   object returned by the earlier call. In other cases, a new
   <code><a href=#nodelist>NodeList</a></code> object must be returned.</p>
 
-  <p>The <dfn id=dom-document-getelementsbyclassname title=dom-document-getElementsByClassName><code>getElementsByClassName(<var title="">classNames</var>)</code></dfn> method takes a string that
-  contains a <a href=#set-of-space-separated-tokens>set of space-separated tokens</a> representing
-  classes. When called, the method must return a <a href=#live>live</a>
-  <code><a href=#nodelist>NodeList</a></code> object containing all the elements in the
-  document, in <a href=#tree-order>tree order</a>, that have all the classes
-  specified in that argument, having obtained the classes by <a href=#split-a-string-on-spaces title="split a string on spaces">splitting a string on
-  spaces</a>. (Duplicates are ignored.) If there are no tokens
-  specified in the argument, then the method must return an empty
-  <code><a href=#nodelist>NodeList</a></code>. If the document is in <a href=#quirks-mode>quirks
-  mode</a>, then the comparisons for the classes must be done in an
-  <a href=#ascii-case-insensitive>ASCII case-insensitive</a> manner, otherwise, the
-  comparisons must be done in a <a href=#case-sensitive>case-sensitive</a> manner.
-  When the method is invoked on a <code><a href=#document>Document</a></code> object again
-  with the same argument, the user agent may return the same object as
-  the object returned by the earlier call. In other cases, a new
-  <code><a href=#nodelist>NodeList</a></code> object must be returned.</p>
-
-  <p>The <dfn id=dom-getelementsbyclassname title=dom-getElementsByClassName><code>getElementsByClassName(<var title="">classNames</var>)</code></dfn> method on the
-  <code><a href=#htmlelement>HTMLElement</a></code> interface must return a <a href=#live>live</a>
-  <code><a href=#nodelist>NodeList</a></code> with the nodes that the
-  <code><a href=#htmldocument>HTMLDocument</a></code> <code title=dom-document-getElementsByClassName><a href=#dom-document-getelementsbyclassname>getElementsByClassName()</a></code>
-  method would return when passed the same argument(s), excluding any
-  elements that are not descendants of the <code><a href=#htmlelement>HTMLElement</a></code>
-  object on which the method was invoked.
-  When the method is invoked on an <code><a href=#htmlelement>HTMLElement</a></code> object
-  again with the same argument, the user agent may return the same
-  object as the object returned by the earlier call. In other cases, a
-  new <code><a href=#nodelist>NodeList</a></code> object must be returned.</p>
-
   </div>
 
-  <p>HTML, SVG, and MathML elements define which classes they are in
-  by having an attribute with no namespace with the name <code title="">class</code> containing a space-separated list of classes
-  to which the element belongs. Other specifications may also allow
-  elements in their namespaces to be labeled as being in specific
-  classes.</p>
-
-  <div class=example>
-
-   <p>Given the following XHTML fragment:</p>
-
-   <pre><div id="example">
- <p id="p1" class="aaa bbb"/>
- <p id="p2" class="aaa ccc"/>
- <p id="p3" class="bbb ccc"/>
-</div></pre>
-
-   <p>A call to <code title="">document.getElementById('example').getElementsByClassName('aaa')</code>
-   would return a <code><a href=#nodelist>NodeList</a></code> with the two paragraphs <code title="">p1</code> and <code title="">p2</code> in it.</p>
-
-   <p>A call to <code title="">getElementsByClassName('ccc bbb')</code> would only
-   return one node, however, namely <code title="">p3</code>. A call
-   to <code title="">document.getElementById('example').getElementsByClassName('bbb  ccc ')</code>
-   would return the same thing.</p>
-
-   <p>A call to <code title="">getElementsByClassName('aaa,bbb')</code> would return no
-   nodes; none of the elements above are in the "aaa,bbb" class.</p>
-
-  </div>
-
-<!-- v2:
->         * xGetParentElementByClassName(rootElement, className, tagName) -
-> Navigates upwards until we hit a parent element with the given class name and
-> optional tag name.
--->
-
 <!--CSSREF-->
   <hr><dl class=domintro><dt><var title="">element</var> . <code title=dom-document-cssElementMap><a href=#dom-document-csselementmap>cssElementMap</a></code></dt>
    <dd>
@@ -9832,9 +9757,6 @@
   requirements,</span> is the <code><a href=#htmlelement>HTMLElement</a></code> interface.</p>
 
   <pre class=idl>interface <dfn id=htmlelement>HTMLElement</dfn> : <a href=#element>Element</a> {
-  // <a href=#dom-tree-accessors>DOM tree accessors</a>
-  NodeList <a href=#dom-getelementsbyclassname title=dom-getElementsByClassName>getElementsByClassName</a>(in DOMString classNames);
-
   // <a href=#dynamic-markup-insertion>dynamic markup insertion</a>
            attribute DOMString <a href=#dom-innerhtml title=dom-innerHTML>innerHTML</a>;
            attribute DOMString <a href=#dom-outerhtml title=dom-outerHTML>outerHTML</a>;
@@ -10524,7 +10446,7 @@
   </div>
 
   <p class=note>Assigning classes to an element affects class
-  matching in selectors in CSS, the <code title=dom-document-getElementsByClassName><a href=#dom-document-getelementsbyclassname>getElementsByClassName()</a></code>
+  matching in selectors in CSS, the <code title=dom-document-getElementsByClassName>getElementsByClassName()</code>
   method in the DOM, and other such features.</p>
 
   <p>There are no additional restrictions on the tokens authors can

Modified: source
===================================================================
--- source	2011-07-27 20:37:32 UTC (rev 6330)
+++ source	2011-07-27 23:04:04 UTC (rev 6331)
@@ -8861,7 +8861,6 @@
   readonly attribute <span>HTMLCollection</span> <span title="dom-document-forms">forms</span>;
   readonly attribute <span>HTMLCollection</span> <span title="dom-document-scripts">scripts</span>;
   NodeList <span title="dom-document-getElementsByName">getElementsByName</span>(in DOMString elementName);
-  NodeList <span title="dom-document-getElementsByClassName">getElementsByClassName</span>(in DOMString classNames);
 <!--END w3c-html--><!--MD-->  NodeList <span title="dom-document-getItems">getItems</span>(in optional DOMString typeNames); // <span>microdata</span> <!--WARNING: ALSO DUPLICATED IN MICRODATA SECTION--><!--START w3c-html--><!--MD-->
 <!--END w3c-html--><!--CSSREF-->  readonly attribute <span>DOMElementMap</span> <span title="dom-document-cssElementMap">cssElementMap</span>;<!--START w3c-html--><!--CSSREF-->
 
@@ -9472,17 +9471,6 @@
     attribute with the value <var title="">name</var>.</p>
    </dd>
 
-   <dt><var title="">collection</var> = <var title="">document</var> . <code title="dom-document-getElementsByClassName">getElementsByClassName(<var title="">classes</var>)</code></dt>
-   <dt><var title="">collection</var> = <var title="">element</var> . <code title="dom-getElementsByClassName">getElementsByClassName(<var title="">classes</var>)</code></dt>
-   <dd>
-    <p>Returns a <code>NodeList</code> of the elements in the object
-    on which the method was invoked (a <code>Document</code> or an
-    <code>Element</code>) that have all the classes given by <var
-    title="">classes</var>.</p>
-    <p>The <var title="">classes</var> argument is interpreted as a
-    space-separated list of classes.</p>
-   </dd>
-
   </dl>
 
   <div class="impl">
@@ -9500,84 +9488,8 @@
   object returned by the earlier call. In other cases, a new
   <code>NodeList</code> object must be returned.</p>
 
-  <p>The <dfn
-  title="dom-document-getElementsByClassName"><code>getElementsByClassName(<var
-  title="">classNames</var>)</code></dfn> method takes a string that
-  contains a <span>set of space-separated tokens</span> representing
-  classes. When called, the method must return a <span>live</span>
-  <code>NodeList</code> object containing all the elements in the
-  document, in <span>tree order</span>, that have all the classes
-  specified in that argument, having obtained the classes by <span
-  title="split a string on spaces">splitting a string on
-  spaces</span>. (Duplicates are ignored.) If there are no tokens
-  specified in the argument, then the method must return an empty
-  <code>NodeList</code>. If the document is in <span>quirks
-  mode</span>, then the comparisons for the classes must be done in an
-  <span>ASCII case-insensitive</span> manner, otherwise, the
-  comparisons must be done in a <span>case-sensitive</span> manner.
-  When the method is invoked on a <code>Document</code> object again
-  with the same argument, the user agent may return the same object as
-  the object returned by the earlier call. In other cases, a new
-  <code>NodeList</code> object must be returned.</p>
-
-  <p>The <dfn
-  title="dom-getElementsByClassName"><code>getElementsByClassName(<var
-  title="">classNames</var>)</code></dfn> method on the
-  <code>HTMLElement</code> interface must return a <span>live</span>
-  <code>NodeList</code> with the nodes that the
-  <code>HTMLDocument</code> <code
-  title="dom-document-getElementsByClassName">getElementsByClassName()</code>
-  method would return when passed the same argument(s), excluding any
-  elements that are not descendants of the <code>HTMLElement</code>
-  object on which the method was invoked.
-  When the method is invoked on an <code>HTMLElement</code> object
-  again with the same argument, the user agent may return the same
-  object as the object returned by the earlier call. In other cases, a
-  new <code>NodeList</code> object must be returned.</p>
-
   </div>
 
-  <p>HTML, SVG, and MathML elements define which classes they are in
-  by having an attribute with no namespace with the name <code
-  title="">class</code> containing a space-separated list of classes
-  to which the element belongs. Other specifications may also allow
-  elements in their namespaces to be labeled as being in specific
-  classes.</p>
-
-  <div class="example">
-
-   <p>Given the following XHTML fragment:</p>
-
-   <pre><div id="example">
- <p id="p1" class="aaa bbb"/>
- <p id="p2" class="aaa ccc"/>
- <p id="p3" class="bbb ccc"/>
-</div></pre>
-
-   <p>A call to <code
-   title="">document.getElementById('example').getElementsByClassName('aaa')</code>
-   would return a <code>NodeList</code> with the two paragraphs <code
-   title="">p1</code> and <code title="">p2</code> in it.</p>
-
-   <p>A call to <code
-   title="">getElementsByClassName('ccc bbb')</code> would only
-   return one node, however, namely <code title="">p3</code>. A call
-   to <code
-   title="">document.getElementById('example').getElementsByClassName('bbb  ccc ')</code>
-   would return the same thing.</p>
-
-   <p>A call to <code
-   title="">getElementsByClassName('aaa,bbb')</code> would return no
-   nodes; none of the elements above are in the "aaa,bbb" class.</p>
-
-  </div>
-
-<!-- v2:
->         * xGetParentElementByClassName(rootElement, className, tagName) -
-> Navigates upwards until we hit a parent element with the given class name and
-> optional tag name.
--->
-
 <!--END w3c-html--><!--CSSREF-->
   <hr>
 
@@ -10150,9 +10062,6 @@
   requirements,</span> is the <code>HTMLElement</code> interface.</p>
 
   <pre class="idl">interface <dfn>HTMLElement</dfn> : <span>Element</span> {
-  // <span>DOM tree accessors</span>
-  NodeList <span title="dom-getElementsByClassName">getElementsByClassName</span>(in DOMString classNames);
-
   // <span>dynamic markup insertion</span>
            attribute DOMString <span title="dom-innerHTML">innerHTML</span>;
            attribute DOMString <span title="dom-outerHTML">outerHTML</span>;




More information about the Commit-Watchers mailing list