[html5] r3254 - [] (0) Make DOMTokenList be sorted by the underlying string only.
whatwg at whatwg.org
whatwg at whatwg.org
Mon Jun 15 12:24:05 PDT 2009
Author: ianh
Date: 2009-06-15 12:24:03 -0700 (Mon, 15 Jun 2009)
New Revision: 3254
Modified:
index
source
Log:
[] (0) Make DOMTokenList be sorted by the underlying string only.
Modified: index
===================================================================
--- index 2009-06-15 18:54:26 UTC (rev 3253)
+++ index 2009-06-15 19:24:03 UTC (rev 3254)
@@ -5689,7 +5689,7 @@
<p class=note>While the order of the tokens in the underlying
string is not important, the <code><a href=#domtokenlist-0>DOMTokenList</a></code> interfaces
- exposes the tokens in a well-defined order for consistency between
+ preserves the underlying order for consistency between
implementations.</p>
<pre class=idl>[<a href=#dom-tokenlist-tostring title=dom-tokenlist-toString>Stringifies</a>] interface <dfn id=domtokenlist-0>DOMTokenList</dfn> {
@@ -5753,13 +5753,15 @@
there are no <span>supported indexed properties</span>.</p>
<p>The <dfn id=dom-tokenlist-item title=dom-tokenlist-item><code>item(<var title="">index</var>)</code></dfn> method must <a href=#split-a-string-on-spaces title="split a
- string on spaces">split the underlying string on spaces</a>, sort
- the resulting list of tokens by Unicode code point<!-- XXX that's
- basically nonsense. What sort order do we want here? It should be
- the cheapest one possible that is well-defined for all Unicode. -->,
- remove exact duplicates, and then return the <var title="">index</var>th item in this list. If <var title="">index</var> is equal to or greater than the number of
+ string on spaces">split the underlying string on spaces</a>,
+ preserving the order of the tokens as found in the underlying
+ string, remove instances of exact duplicates other than the first
+ instance in each case, and then return the <var title="">index</var>th item in this list. If <var title="">index</var> is equal to or greater than the number of
tokens, then the method must return null.</p>
+ <p class=example>For example, if the string is "<code title="">a b
+ a c</code>" then there are three tokens: the token with index 0 is
+ "<code title="">a</code>", the token with index 1 is "<code title="">b</code>", and the token with index 2 is "<code title="">c</code>".</p>
<p>The <dfn id=dom-tokenlist-has title=dom-tokenlist-has><code>has(<var title="">token</var>)</code></dfn> method must run the following
algorithm:</p>
Modified: source
===================================================================
--- source 2009-06-15 18:54:26 UTC (rev 3253)
+++ source 2009-06-15 19:24:03 UTC (rev 3254)
@@ -5472,7 +5472,7 @@
<p class="note">While the order of the tokens in the underlying
string is not important, the <code>DOMTokenList</code> interfaces
- exposes the tokens in a well-defined order for consistency between
+ preserves the underlying order for consistency between
implementations.</p>
<pre class="idl">[<span title="dom-tokenlist-toString">Stringifies</span>] interface <dfn>DOMTokenList</dfn> {
@@ -5544,15 +5544,19 @@
<p>The <dfn title="dom-tokenlist-item"><code>item(<var
title="">index</var>)</code></dfn> method must <span title="split a
- string on spaces">split the underlying string on spaces</span>, sort
- the resulting list of tokens by Unicode code point<!-- XXX that's
- basically nonsense. What sort order do we want here? It should be
- the cheapest one possible that is well-defined for all Unicode. -->,
- remove exact duplicates, and then return the <var
+ string on spaces">split the underlying string on spaces</span>,
+ preserving the order of the tokens as found in the underlying
+ string, remove instances of exact duplicates other than the first
+ instance in each case, and then return the <var
title="">index</var>th item in this list. If <var
title="">index</var> is equal to or greater than the number of
tokens, then the method must return null.</p>
+ <p class="example">For example, if the string is "<code title="">a b
+ a c</code>" then there are three tokens: the token with index 0 is
+ "<code title="">a</code>", the token with index 1 is "<code
+ title="">b</code>", and the token with index 2 is "<code
+ title="">c</code>".</p>
<p>The <dfn title="dom-tokenlist-has"><code>has(<var
title="">token</var>)</code></dfn> method must run the following
More information about the Commit-Watchers
mailing list