Skip to content

Commit

Permalink
[giow] (2) Introduce more magic for document.all.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@3403 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 14, 2009
1 parent c36aed0 commit 1174692
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 19 deletions.
34 changes: 25 additions & 9 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -71225,15 +71225,31 @@ time:empty { binding: <i title="">time</i>; }</pre>
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>
<p>The object returned for <code title=dom-document-all><a href=#dom-document-all>all</a></code>
has several unusual behaviors:</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><a href=#dom-document-all>all</a></code> to the false value.</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><a href=#dom-document-all>all</a></code> is equal to the <code title="">undefined</code> value.</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><a href=#dom-document-all>all</a></code>.</li>

</ul><p class=note>These requirements are 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, 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><a href=#dom-document-all>document.all</a></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><a href=#dom-document-all>document.all</a></code> object without testing
for its presence first. <a href=#refsECMA262>[ECMA262]</a></p>

</div>

Expand Down
45 changes: 35 additions & 10 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -84058,16 +84058,41 @@ time:empty { binding: <i title="">time</i>; }</pre>
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>
<p>The object returned for <code title="dom-document-all">all</code>
has several unusual behaviors:</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>

Expand Down

0 comments on commit 1174692

Please sign in to comment.