[html5] r3155 - [] (0) document.all (bug 6766)

whatwg at whatwg.org whatwg at whatwg.org
Sun May 31 01:45:16 PDT 2009


Author: ianh
Date: 2009-05-31 01:45:14 -0700 (Sun, 31 May 2009)
New Revision: 3155

Modified:
   index
   source
Log:
[] (0) document.all (bug 6766)

Modified: index
===================================================================
--- index	2009-05-30 22:41:09 UTC (rev 3154)
+++ index	2009-05-31 08:45:14 UTC (rev 3155)
@@ -39,7 +39,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 30 May 2009</h2>
+   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 31 May 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <dl><dt>Multiple-page version:</dt>
@@ -6179,11 +6179,13 @@
   <p>The <code><a href=#htmlcollection-0>HTMLCollection</a></code> interface represents a generic
   <a href=#collections-0 title=collections>collection</a> of elements.</p>
 
+  <!-- XXX IE does [Callable] with magic that calls item() or namedItem() as appropriate as if it were a regular [[Get]] -->
   <pre class=idl>[Callable=<a href=#dom-htmlcollection-nameditem title=dom-HTMLCollection-namedItem>namedItem</a>]
 interface <dfn id=htmlcollection-0>HTMLCollection</dfn> {
   readonly attribute unsigned long <a href=#dom-htmlcollection-length title=dom-HTMLCollection-length>length</a>;
   [IndexGetter] Element <a href=#dom-htmlcollection-item title=dom-HTMLCollection-item>item</a>(in unsigned long index);
   [NameGetter] Element <a href=#dom-htmlcollection-nameditem title=dom-HTMLCollection-namedItem>namedItem</a>(in DOMString name);
+  <a href=#htmlcollection-0>HTMLCollection</a> <a href=#dom-htmlcollection-tags title=dom-HTMLCollection-tags>tags</a>(in DOMString tagName);
 };</pre>
 
   <dl class=domintro><dt><var title="">collection</var> . <code title=dom-HTMLCollection-length><a href=#dom-htmlcollection-length>length</a></code></dt>
@@ -6212,6 +6214,11 @@
     this method; their name is given by the value of their <code title="">name</code> attribute.</p>
    </dd>
 
+   <dt><var title="">collection</var> = <var title="">collection</var> . <code title=dom-HTMLCollection-tags><a href=#dom-htmlcollection-tags>tags</a></code>(<var title="">tagName</var>)</dt>
+   <dd>
+    <p>Returns a collection that is a filtered view of the current collection, containing only elements with the given tag name.</p>
+   </dd>
+
   </dl><div class=impl>
 
   <hr><p>The object's <span>indices of the supported indexed
@@ -6251,6 +6258,14 @@
   </ul><p>If no such elements are found, then the method must return
   null.</p>
 
+  <p>The <dfn id=dom-htmlcollection-tags title=dom-HTMLCollection-tags><code>tags(<var title="">tagName</var>)</code></dfn> method must return an
+  <code><a href=#htmlcollection-0>HTMLCollection</a></code> rooted at the same node as the
+  <code><a href=#htmlcollection-0>HTMLCollection</a></code> object on which the method was invoked,
+  whose filter matches only <a href=#html-elements>HTML elements</a> whose local
+  name is the <var title="">tagName</var> argument. In <a href=#html-documents>HTML
+  documents</a>, the argument must first be <a href=#converted-to-lowercase>converted to
+  lowercase</a>.</p>
+
   </div>
 
 
@@ -70401,6 +70416,8 @@
            attribute DOMString <a href=#dom-document-linkcolor title=dom-document-linkColor>linkColor</a>;
            attribute DOMString <a href=#dom-document-vlinkcolor title=dom-document-vlinkColor>vlinkColor</a>;
            attribute DOMString <a href=#dom-document-alinkcolor title=dom-document-alinkColor>alinkColor</a>;
+
+  readonly attribute <a href=#htmlcollection-0>HTMLCollection</a> <a href=#dom-document-all title=dom-document-all>all</a>;
 };</pre>
 
   <p>The <dfn id=dom-document-fgcolor title=dom-document-fgColor><code>fgColor</code></dfn>
@@ -70432,8 +70449,21 @@
   element">body element</a>, the attributes must instead return the
   empty string on getting and do nothing on setting.</p>
 
+  <hr><p>The <dfn id=dom-document-all title=dom-document-all><code>all</code></dfn>
+  attribute must return an <code><a href=#htmlcollection-0>HTMLCollection</a></code> rooted at the
+  <code>Document</code> node, whose filter matches all elements.</p>
 
+  <p>The user agent must act as if the ToBoolean() operator in
+  JavaScript converted the object returned for <code title=dom-document-all><a href=#dom-document-all>all</a></code> to the false value.</p>
 
+  <p class=note>This is a <a href=#willful-violation>willful violation</a> of the
+  JavaScript specification current at the time of writing (ECMAScript
+  edition 3). The JavaScript specification requires that the
+  ToBoolean() operator convert all objects to the true value.  This
+  violation is motivated by a desire for compatibility with legacy
+  content. <a href=#refsECMA262>[ECMA262]</a></p>
+
+
   <h3 id=conformance-checkers-0><span class=secno>12.4 </span>Conformance checkers</h3>
 
   <p>To ease the transition from HTML4 Transitional documents to the

Modified: source
===================================================================
--- source	2009-05-30 22:41:09 UTC (rev 3154)
+++ source	2009-05-31 08:45:14 UTC (rev 3155)
@@ -6049,11 +6049,13 @@
   <p>The <code>HTMLCollection</code> interface represents a generic
   <span title="collections">collection</span> of elements.</p>
 
+  <!-- XXX IE does [Callable] with magic that calls item() or namedItem() as appropriate as if it were a regular [[Get]] -->
   <pre class="idl">[Callable=<span title="dom-HTMLCollection-namedItem">namedItem</span>]
 interface <dfn>HTMLCollection</dfn> {
   readonly attribute unsigned long <span title="dom-HTMLCollection-length">length</span>;
   [IndexGetter] Element <span title="dom-HTMLCollection-item">item</span>(in unsigned long index);
   [NameGetter] Element <span title="dom-HTMLCollection-namedItem">namedItem</span>(in DOMString name);
+  <span>HTMLCollection</span> <span title="dom-HTMLCollection-tags">tags</span>(in DOMString tagName);
 };</pre>
 
   <dl class="domintro">
@@ -6085,6 +6087,11 @@
     title="">name</code> attribute.</p>
    </dd>
 
+   <dt><var title="">collection</var> = <var title="">collection</var> . <code title="dom-HTMLCollection-tags">tags</code>(<var title="">tagName</var>)</dt>
+   <dd>
+    <p>Returns a collection that is a filtered view of the current collection, containing only elements with the given tag name.</p>
+   </dd>
+
   </dl>
 
   <div class="impl">
@@ -6139,6 +6146,15 @@
   <p>If no such elements are found, then the method must return
   null.</p>
 
+  <p>The <dfn title="dom-HTMLCollection-tags"><code>tags(<var
+  title="">tagName</var>)</code></dfn> method must return an
+  <code>HTMLCollection</code> rooted at the same node as the
+  <code>HTMLCollection</code> object on which the method was invoked,
+  whose filter matches only <span>HTML elements</span> whose local
+  name is the <var title="">tagName</var> argument. In <span>HTML
+  documents</span>, the argument must first be <span>converted to
+  lowercase</span>.</p>
+
   </div>
 
 
@@ -83030,6 +83046,8 @@
            attribute DOMString <span title="dom-document-linkColor">linkColor</span>;
            attribute DOMString <span title="dom-document-vlinkColor">vlinkColor</span>;
            attribute DOMString <span title="dom-document-alinkColor">alinkColor</span>;
+
+  readonly attribute <span>HTMLCollection</span> <span title="dom-document-all">all</span>;
 };</pre>
 
   <p>The <dfn title="dom-document-fgColor"><code>fgColor</code></dfn>
@@ -83061,8 +83079,24 @@
   element">body element</span>, the attributes must instead return the
   empty string on getting and do nothing on setting.</p>
 
+  <hr>
 
+  <p>The <dfn title="dom-document-all"><code>all</code></dfn>
+  attribute must return an <code>HTMLCollection</code> rooted at the
+  <code>Document</code> node, whose filter matches all elements.</p>
 
+  <p>The user agent must act as if the ToBoolean() operator in
+  JavaScript converted the object returned for <code
+  title="dom-document-all">all</code> to the false value.</p>
+
+  <p class="note">This is a <span>willful violation</span> of the
+  JavaScript specification current at the time of writing (ECMAScript
+  edition 3). The JavaScript specification requires that the
+  ToBoolean() operator convert all objects to the true value.  This
+  violation is motivated by a desire for compatibility with legacy
+  content. <a href="#refsECMA262">[ECMA262]</a></p>
+
+
   <h3>Conformance checkers</h3>
 
   <p>To ease the transition from HTML4 Transitional documents to the




More information about the Commit-Watchers mailing list