- From: poot <cvsmail@w3.org>
- Date: Tue, 16 Jun 2009 04:24:25 +0900 (JST)
- To: public-html-diffs@w3.org
Make DOMTokenList be sorted by the underlying string only. (whatwg r3254) http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.2401&r2=1.2402&f=h http://html5.org/tools/web-apps-tracker?from=3253&to=3254 =================================================================== RCS file: /sources/public/html5/spec/Overview.html,v retrieving revision 1.2401 retrieving revision 1.2402 diff -u -d -r1.2401 -r1.2402 --- Overview.html 15 Jun 2009 18:54:32 -0000 1.2401 +++ Overview.html 15 Jun 2009 19:24:09 -0000 1.2402 @@ -5113,7 +5113,7 @@ to an underlying string that consists of an <a href="#unordered-set-of-unique-space-separated-tokens">unordered set of unique space-separated tokens</a>.<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.<pre class="idl">[<a href="#dom-tokenlist-tostring" title="dom-tokenlist-toString">Stringifies</a>] interface <dfn id="domtokenlist-0">DOMTokenList</dfn> { readonly attribute unsigned long <a href="#dom-tokenlist-length" title="dom-tokenlist-length">length</a>; [IndexGetter] DOMString <a href="#dom-tokenlist-item" title="dom-tokenlist-item">item</a>(in unsigned long index); @@ -5173,13 +5173,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>
Received on Monday, 15 June 2009 19:24:57 UTC