[html5] r2655 - [e] (0) Revamp how <form> handles enumeration, for better compatibility with Web [...]
whatwg at whatwg.org
whatwg at whatwg.org
Tue Jan 13 03:26:07 PST 2009
Author: ianh
Date: 2009-01-13 03:26:06 -0800 (Tue, 13 Jan 2009)
New Revision: 2655
Modified:
index
source
Log:
[e] (0) Revamp how <form> handles enumeration, for better compatibility with WebIDL and IE.
Modified: index
===================================================================
--- index 2009-01-13 10:57:04 UTC (rev 2654)
+++ index 2009-01-13 11:26:06 UTC (rev 2655)
@@ -5374,6 +5374,7 @@
<li>Otherwise, if there are no nodes in the collection that have
either an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute or a <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attribute equal to <var title="">key</var>, then return null and stop the algorithm.</li>
+ <!-- XXX should we return an HTMLCollection instead, like IE? -->
<li>Otherwise, create a <code>NodeList</code> object representing a
live view of the <code><a href=#htmlformcontrolscollection-0>HTMLFormControlsCollection</a></code> object,
further filtered so that the only nodes in the
@@ -5436,6 +5437,7 @@
<li>Otherwise, if there are no nodes in the collection that have
either an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute or a <code title=attr-option-name>name</code> attribute equal to <var title="">key</var>, then return null and stop the algorithm.</li>
+ <!-- XXX should we return an HTMLCollection instead, like IE? -->
<li>Otherwise, create a <code>NodeList</code> object representing a
live view of the <code><a href=#htmloptionscollection-0>HTMLOptionsCollection</a></code> object, further
filtered so that the only nodes in the <code>NodeList</code> object
@@ -23774,10 +23776,7 @@
<dd><code title=attr-fs-target><a href=#attr-fs-target>target</a></code></dd>
<dt>DOM interface:</dt>
<dd>
-<pre class=idl>[NameGetter, IndexGetter]<!--
-XXX add Callable=namedItem; add namedItem (IE compat); maybe make form.elements === form? matters in cases like: form.elements.x.x:
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A%3Cform%20name%3Da%3E%3Cinput%20name%3Db%3E%3Cinput%20name%3Db%3E%3C%2Fform%3E%3Cscript%20id%3Da%3Ew(document.forms('a').elements('b')('b'))%3C%2Fscript%3E
--->
+<pre class=idl>[Callable=<a href=#dom-form-nameditem title=dom-form-namedItem>namedItem</a>]
interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
attribute DOMString <a href=#dom-form-accept-charset title=dom-form-accept-charset>accept-charset</a>;
attribute DOMString <a href=#dom-fs-action title=dom-fs-action>action</a>;
@@ -23789,6 +23788,8 @@
readonly attribute <a href=#htmlformcontrolscollection-0>HTMLFormControlsCollection</a> <a href=#dom-form-elements title=dom-form-elements>elements</a>;
readonly attribute long <a href=#dom-form-length title=dom-form-length>length</a>;
+ [IndexGetter] any <a href=#dom-form-item title=dom-form-item>item</a>(in DOMString name);
+ [NameGetter=OverrideBuiltins] any <a href=#dom-form-nameditem title=dom-form-namedItem>namedItem</a>(in DOMString name);
void <a href=#dom-form-submit title=dom-form-submit>submit</a>();
void <a href=#dom-form-reset title=dom-form-reset>reset</a>();
@@ -23837,16 +23838,19 @@
<span>indices of the supported indexed properties</span> at any
instant are the indicies supported by the object returned by the
<code title=dom-form-elements><a href=#dom-form-elements>elements</a></code> attribute at that
- instant. The value of the <span>corresponding indexed
- property</span> whenever an indexed property is retrieved is the
- value of the <span>corresponding indexed property</span> on the
- object returned by the <code title=dom-form-elements><a href=#dom-form-elements>elements</a></code> attribute. The <span>names
+ instant. The <span>names
of the supported named properties</span> at any instant are the
names supported by the object returned by the <code title=dom-form-elements><a href=#dom-form-elements>elements</a></code> attribute at that
- instant. The value of a property with a name <var title="">name</var> at any instant is the property with the same
- name on the object returned by the <code title=dom-form-elements><a href=#dom-form-elements>elements</a></code> attribute at the same
instant.</p>
+ <p>The <dfn id=dom-form-item title=dom-form-item><code>item(<var title="">index</var>)</code></dfn> method must return the value
+ returned by the method of the same name on the <code title=dom-form-elements><a href=#dom-form-elements>elements</a></code> collection, when invoked
+ with the same argument.</p>
+
+ <p>The <dfn id=dom-form-nameditem title=dom-form-namedItem><code>namedItem(<var title="">index</var>)</code></dfn> method must return the value
+ returned by the method of the same name on the <code title=dom-form-elements><a href=#dom-form-elements>elements</a></code> collection, when invoked
+ with the same argument.</p>
+
<p>The <dfn id=dom-form-submit title=dom-form-submit><code>submit()</code></dfn>
method, when invoked, must <a href=#concept-form-submit title=concept-form-submit>submit</a> the <code><a href=#the-form-element>form</a></code>
element from the <code><a href=#the-form-element>form</a></code> element itself.</p>
Modified: source
===================================================================
--- source 2009-01-13 10:57:04 UTC (rev 2654)
+++ source 2009-01-13 11:26:06 UTC (rev 2655)
@@ -5231,6 +5231,7 @@
title="attr-fe-name">name</code> attribute equal to <var
title="">key</var>, then return null and stop the algorithm.</li>
+ <!-- XXX should we return an HTMLCollection instead, like IE? -->
<li>Otherwise, create a <code>NodeList</code> object representing a
live view of the <code>HTMLFormControlsCollection</code> object,
further filtered so that the only nodes in the
@@ -5316,6 +5317,7 @@
title="attr-option-name">name</code> attribute equal to <var
title="">key</var>, then return null and stop the algorithm.</li>
+ <!-- XXX should we return an HTMLCollection instead, like IE? -->
<li>Otherwise, create a <code>NodeList</code> object representing a
live view of the <code>HTMLOptionsCollection</code> object, further
filtered so that the only nodes in the <code>NodeList</code> object
@@ -26448,10 +26450,7 @@
<dd><code title="attr-fs-target">target</code></dd>
<dt>DOM interface:</dt>
<dd>
-<pre class="idl">[NameGetter, IndexGetter]<!--
-XXX add Callable=namedItem; add namedItem (IE compat); maybe make form.elements === form? matters in cases like: form.elements.x.x:
-http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0D%0A%3Cform%20name%3Da%3E%3Cinput%20name%3Db%3E%3Cinput%20name%3Db%3E%3C%2Fform%3E%3Cscript%20id%3Da%3Ew(document.forms('a').elements('b')('b'))%3C%2Fscript%3E
--->
+<pre class="idl">[Callable=<span title="dom-form-namedItem">namedItem</span>]
interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
attribute DOMString <span title="dom-form-accept-charset">accept-charset</span>;
attribute DOMString <span title="dom-fs-action">action</span>;
@@ -26463,6 +26462,8 @@
readonly attribute <span>HTMLFormControlsCollection</span> <span title="dom-form-elements">elements</span>;
readonly attribute long <span title="dom-form-length">length</span>;
+ [IndexGetter] any <span title="dom-form-item">item</span>(in DOMString name);
+ [NameGetter=OverrideBuiltins] any <span title="dom-form-namedItem">namedItem</span>(in DOMString name);
void <span title="dom-form-submit">submit</span>();
void <span title="dom-form-reset">reset</span>();
@@ -26527,20 +26528,24 @@
<span>indices of the supported indexed properties</span> at any
instant are the indicies supported by the object returned by the
<code title="dom-form-elements">elements</code> attribute at that
- instant. The value of the <span>corresponding indexed
- property</span> whenever an indexed property is retrieved is the
- value of the <span>corresponding indexed property</span> on the
- object returned by the <code
- title="dom-form-elements">elements</code> attribute. The <span>names
+ instant. The <span>names
of the supported named properties</span> at any instant are the
names supported by the object returned by the <code
title="dom-form-elements">elements</code> attribute at that
- instant. The value of a property with a name <var
- title="">name</var> at any instant is the property with the same
- name on the object returned by the <code
- title="dom-form-elements">elements</code> attribute at the same
instant.</p>
+ <p>The <dfn title="dom-form-item"><code>item(<var
+ title="">index</var>)</code></dfn> method must return the value
+ returned by the method of the same name on the <code
+ title="dom-form-elements">elements</code> collection, when invoked
+ with the same argument.</p>
+
+ <p>The <dfn title="dom-form-namedItem"><code>namedItem(<var
+ title="">index</var>)</code></dfn> method must return the value
+ returned by the method of the same name on the <code
+ title="dom-form-elements">elements</code> collection, when invoked
+ with the same argument.</p>
+
<p>The <dfn title="dom-form-submit"><code>submit()</code></dfn>
method, when invoked, must <span
title="concept-form-submit">submit</span> the <code>form</code>
More information about the Commit-Watchers
mailing list