HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/3403

File a bug

SVNBugCommentTime (UTC)
3403[Gecko] [Internet Explorer] [Opera] [Webkit] Introduce more magic for document.all.2009-07-14 04:59
Index: source
===================================================================
--- source	(revision 3402)
+++ source	(revision 3403)
@@ -84058,17 +84058,42 @@
   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>The object returned for <code title="dom-document-all">all</code>
+  has several unusual behaviors:</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>
+  <ul>
 
+   <li><p>The user agent must act as if the ToBoolean() operator in
+   JavaScript converts the object returned for <code
+   title="dom-document-all">all</code> to the false value.</p></li>
+
+   <li><p>The user agent must act as if, for the purposes of the <code
+   title="">==</code> and <code title="">!=</code> operators in
+   JavaScript, the object returned for <code
+   title="dom-document-all">all</code> is equal to the <code
+   title="">undefined</code> value.</p></li>
+
+   <li><p>The user agent must act such that the <code
+   title="">typeof</code> operator in JavaScript returns the string
+   <code title="">undefined</code> when applied to the object returned
+   for <code title="dom-document-all">all</code>.</p></li>
+
+  </ul>
+
+  <p class="note">These requirements are 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, and does not have provisions for objects acting as if
+  they were <code title="">undefined</code> for the purposes of
+  certain operators. This violation is motivated by a desire for
+  compatibility with two classes of legacy content: one that uses the
+  presence of <code title="dom-document-all">document.all</code> as a
+  way to detect legacy user agents, and one that only supports those
+  legacy user agents and uses the <code
+  title="dom-document-all">document.all</code> object without testing
+  for its presence first. <a href="#refsECMA262">[ECMA262]</a></p>
+
   </div>
 
 

|