[html5] r825 - /
whatwg at whatwg.org
whatwg at whatwg.org
Wed May 16 23:29:07 PDT 2007
Author: ianh
Date: 2007-05-16 23:29:06 -0700 (Wed, 16 May 2007)
New Revision: 825
Modified:
index
source
Log:
[] (0) DOMTokenList can now be enumerated.
Modified: index
===================================================================
--- index 2007-05-17 05:32:17 UTC (rev 824)
+++ index 2007-05-17 06:29:06 UTC (rev 825)
@@ -2943,12 +2943,37 @@
href="#datagrid0">datagrid</a></code> APIs).
<pre class=idl>interface <dfn id=domtokenlist0>DOMTokenList</dfn> {
+ readonly attribute unsigned long <a href="#length2" title=dom-tokenlist-length>length</a>;
+ DOMString <a href="#itemindex2" title=dom-tokenlist-item>item</a>(in unsigned long index);
boolean <a href="#hastoken" title=dom-tokenlist-has>has</a>(in DOMString token);
void <a href="#remove" title=dom-tokenlist-add>add</a>(in DOMString token);
void <span title=dom-tokenlist-remove>remove</span>(in DOMString token);
boolean <a href="#toggle" title=dom-tokenlist-toggle>toggle</a>(in DOMString token);
};</pre>
+ <p>The <dfn id=length2 title=dom-tokenlist-length><code>length</code></dfn>
+ attribute must return the number of <em>unique</em> tokens that result
+ from <a href="#split" title="split a string on spaces">splitting the
+ underlying string on spaces</a>.
+
+ <p>The <dfn id=itemindex2 title=dom-tokenlist-item><code>item(<var
+ title="">index</var>)</code></dfn> method must <a href="#split"
+ title="split a string on spaces">split the underlying string on
+ spaces</a>, sort the resulting list of tokens by Unicode
+ codepoint<!-- 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 tokens, then the method must return null.
+
+ <p>In ECMAScript implementations, objects that implement the <code><a
+ href="#domtokenlist0">DOMTokenList</a></code> interface must also have a
+ [[Get]] method that, when invoked with a property name that is a number,
+ acts like the <code title=dom-tokenlist-item><a
+ href="#itemindex2">item()</a></code> method would when invoked with that
+ argument.
+
<p>The <dfn id=hastoken title=dom-tokenlist-has><code>has(<var
title="">token</var>)</code></dfn> method must run the following
algorithm:
@@ -14326,12 +14351,12 @@
ranges (periods) of time.
<pre class=idl>interface <dfn id=timeranges>TimeRanges</dfn> {
- readonly attribute unsigned long <a href="#length2" title=dom-TimeRanges-length>length</a>;
+ readonly attribute unsigned long <a href="#length3" title=dom-TimeRanges-length>length</a>;
float <a href="#start4" title=dom-TimeRanges-start>start</a>(in unsigned long index);
float <a href="#endindex" title=dom-TimeRanges-end>end</a>(in unsigned long index);
};</pre>
- <p>The <dfn id=length2
+ <p>The <dfn id=length3
title=dom-TimeRanges-length><code>length</code></dfn> DOM attribute must
return the number of ranges represented by the object.
@@ -21101,10 +21126,10 @@
depth, which would then require the selection to be infinite if every row,
including every hidden row, was selected.
- <p>The <dfn id=length3
+ <p>The <dfn id=length4
title=dom-DataGridSelection-length><code>length</code></dfn> attribute
must return the number of rows currently present in the selection. The
- <dfn id=itemindex2 title=dom-DataGridSelection-item><code>item(<var
+ <dfn id=itemindex3 title=dom-DataGridSelection-item><code>item(<var
title="">index</var>)</code></dfn> method must return the <var
title="">index</var>th row in the selection. If the argument is out of
range (less than zero or greater than the number of selected rows minus
@@ -21132,7 +21157,7 @@
method must mark all the rows in the data grid as selected. After a call
to <code title=dom-DataGridSelection-selectAll><a
href="#selectall">selectAll()</a></code>, the <code
- title=dom-DataGridSelection-length><a href="#length3">length</a></code>
+ title=dom-DataGridSelection-length><a href="#length4">length</a></code>
attribute will return the number of rows in the data grid, not counting
children of closed rows.
@@ -21146,7 +21171,7 @@
mark all the rows in the data grid to be marked as not selected. After a
call to <code title=dom-DataGridSelection-clear><a
href="#clear">clear()</a></code>, the <code
- title=dom-DataGridSelection-length><a href="#length3">length</a></code>
+ title=dom-DataGridSelection-length><a href="#length4">length</a></code>
attribute will return zero.
<p>If the <code><a href="#datagrid0">datagrid</a></code> element has a <dfn
@@ -22646,7 +22671,7 @@
// other browsing contexts
readonly attribute <a href="#window">Window</a> <a href="#frames" title=dom-frames>frames</a>;
- readonly attribute unsigned long <a href="#length4" title=dom-length>length</a>;
+ readonly attribute unsigned long <a href="#length5" title=dom-length>length</a>;
readonly attribute <a href="#window">Window</a> <a href="#opener0" title=dom-opener>opener</a>;
<a href="#window">Window</a> <a href="#open2" title=dom-open>open</a>();
<a href="#window">Window</a> <a href="#open2" title=dom-open>open</a>(in DOMString url);
@@ -22863,7 +22888,7 @@
href="#active" title="active document">active</a> <code>Document</code>,
sorted in document order of the elements nesting those browsing contexts.
- <p>The <dfn id=length4 title=dom-length><code>length</code></dfn> DOM
+ <p>The <dfn id=length5 title=dom-length><code>length</code></dfn> DOM
attribute on the <code><a href="#window">Window</a></code> interface must
return the number of <a href="#child" title="child browsing context">child
browsing contexts</a> of the <a href="#active" title="active
@@ -22956,7 +22981,7 @@
href="#history1">History</a></code> interface</h4>
<pre class=idl>interface <dfn id=history1>History</dfn> {
- readonly attribute long <a href="#length5" title=dom-history-length>length</a>;
+ readonly attribute long <a href="#length6" title=dom-history-length>length</a>;
void <a href="#godelta" title=dom-history-go>go</a>(in long delta);
void <a href="#go" title=dom-history-go-0>go</a>();
void <a href="#back" title=dom-history-back>back</a>();
@@ -22965,7 +22990,7 @@
void <a href="#clearstate" title=dom-history-clearState>clearState</a>();
};</pre>
- <p>The <dfn id=length5 title=dom-history-length><code>length</code></dfn>
+ <p>The <dfn id=length6 title=dom-history-length><code>length</code></dfn>
attribute of the <code><a href="#history1">History</a></code> interface
must return the number of entries in this <a href="#session">session
history</a>.
@@ -22978,7 +23003,7 @@
<p>If the index of the <a href="#current0">current entry</a> plus <var
title="">delta</var> is less than zero or greater than or equal to the <a
- href="#length5" title=dom-history-length>number of items in the session
+ href="#length6" title=dom-history-length>number of items in the session
history</a>, then the user agent must do nothing.
<p>If the <var title="">delta</var> is zero, then the user agent must act
@@ -26932,7 +26957,7 @@
<pre class=idl>
interface <dfn id=storage2>Storage</dfn> {
- readonly attribute unsigned long <a href="#length6" title=dom-Storage-length>length</a>;
+ readonly attribute unsigned long <a href="#length7" title=dom-Storage-length>length</a>;
DOMString <a href="#keyn" title=dom-Storage-key>key</a>(in unsigned long index);
<a href="#storageitem">StorageItem</a> <a href="#getitem" title=dom-Storage-getItem>getItem</a>(in DOMString key);
void <a href="#setitem" title=dom-Storage-setItem>setItem</a>(in DOMString key, in DOMString data);
@@ -26964,7 +26989,7 @@
the script in question is running in a <span>secure browsing
context</span><!-- XXX xref -->.
- <p>The <dfn id=length6 title=dom-Storage-length><code>length</code></dfn>
+ <p>The <dfn id=length7 title=dom-Storage-length><code>length</code></dfn>
attribute must return the number of key/value pairs currently present and
<a href="#accessible" title="accessible keys">accessible</a> in the list
associated with the object.
@@ -27462,7 +27487,7 @@
detect any concurrent script execution.
<p>This is required to guarentee that the <code title=dom-Storage-length><a
- href="#length6">length</a></code> attribute of a <code><a
+ href="#length7">length</a></code> attribute of a <code><a
href="#storage2">Storage</a></code> object never changes while a script is
executing, other than in a way that is predictable by the script itself.
@@ -29225,7 +29250,7 @@
void <a href="#clearundo" title=dom-UndoManager-clearUndo>clearUndo</a>();
void <a href="#clearredo" title=dom-UndoManager-clearRedo>clearRedo</a>();
DOMObject <a href="#itemn" title=dom-UndoManager-item>item</a>(in unsigned long index);
- readonly attribute unsigned long <a href="#length7" title=dom-UndoManager-length>length</a>;
+ readonly attribute unsigned long <a href="#length8" title=dom-UndoManager-length>length</a>;
readonly attribute unsigned long <a href="#position0" title=dom-UndoManager-position>position</a>;
};</pre>
@@ -29250,7 +29275,7 @@
entries are absent from the <a href="#undo-transaction">undo transaction
history</a>.
- <p>The <dfn id=length7
+ <p>The <dfn id=length8
title=dom-UndoManager-length><code>length</code></dfn> attribute must
return the number of <a href="#undo-object">undo object</a> entries in the
<a href="#undo-transaction">undo transaction history</a>.
@@ -29274,7 +29299,7 @@
nearest to the <a href="#current3">undo position</a>, on the "redo" side.
If there are no <a href="#undo-object">undo object</a> entries on the
"redo" side, then the attribute must return the same as the <code
- title=dom-UndoManager-length><a href="#length7">length</a></code>
+ title=dom-UndoManager-length><a href="#length8">length</a></code>
attribute. If there are no <a href="#undo-object">undo object</a> entries
on the "undo" side of the <a href="#current3">undo position</a>, the <code
title=dom-UndoManager-position><a href="#position0">position</a></code>
@@ -29321,7 +29346,7 @@
href="#undo-object">undo object</a> entry with the specified <var
title="">index</var>. If the index is less than zero or greater than or
equal to <code title=dom-UndoManager-length><a
- href="#length7">length</a></code> then the method must raise an
+ href="#length8">length</a></code> then the method must raise an
<code>INDEX_SIZE_ERR</code> exception. <a href="#dom-changes">DOM
changes</a> entries are unaffected by this method.
Modified: source
===================================================================
--- source 2007-05-17 05:32:17 UTC (rev 824)
+++ source 2007-05-17 06:29:06 UTC (rev 825)
@@ -1494,12 +1494,37 @@
<code>datagrid</code> APIs).</p>
<pre class="idl">interface <dfn>DOMTokenList</dfn> {
+ readonly attribute unsigned long <span title="dom-tokenlist-length">length</span>;
+ DOMString <span title="dom-tokenlist-item">item</span>(in unsigned long index);
boolean <span title="dom-tokenlist-has">has</span>(in DOMString token);
void <span title="dom-tokenlist-add">add</span>(in DOMString token);
void <span title="dom-tokenlist-remove">remove</span>(in DOMString token);
boolean <span title="dom-tokenlist-toggle">toggle</span>(in DOMString token);
};</pre>
+ <p>The <dfn title="dom-tokenlist-length"><code>length</code></dfn>
+ attribute must return the number of <em>unique</em> tokens that
+ result from <span title="split a string on spaces">splitting the
+ underlying string on spaces</span>.</p>
+
+ <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 codepoint<!-- 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
+ tokens, then the method must return null.</p>
+
+ <p>In ECMAScript implementations, objects that implement the
+ <code>DOMTokenList</code> interface must also have a [[Get]] method
+ that, when invoked with a property name that is a number, acts like
+ the <code title="dom-tokenlist-item">item()</code> method would when
+ invoked with that argument.</p>
+
+
<p>The <dfn title="dom-tokenlist-has"><code>has(<var
title="">token</var>)</code></dfn> method must run the following
algorithm:</p>
More information about the Commit-Watchers
mailing list