Skip to content

Commit

Permalink
[giow] (3) Be even more explicit about the supported property names o…
Browse files Browse the repository at this point in the history
…f a <form>.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=22159
Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@7986 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 18, 2013
1 parent 3335b12 commit 47d1310
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 45 deletions.
72 changes: 58 additions & 14 deletions complete.html
Expand Up @@ -44457,25 +44457,69 @@ <h4 id=categories><span class=secno>4.10.2 </span>Categories</h4>
<hr><!-- Welcome to crazy town. Population: The Web. --><p>Each <code><a href=#the-form-element>form</a></code> element has a mapping of names to elements called the <dfn id=past-names-map>past names
map</dfn>. It is used to persist names of controls even when they change names.</p>

<p>The <a href=#supported-property-names>supported property names</a> consist of:</p>
<p>The <a href=#supported-property-names>supported property names</a> consist of the names obtained from the following
algorithm, in the order obtained from this algorithm:</p>

<ul><li>The values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes of all the <a href=#category-listed title=category-listed>listed
elements</a> whose <a href=#form-owner>form owner</a> is the <code><a href=#the-form-element>form</a></code> element, with the
exception of <code><a href=#the-input-element>input</a></code> elements whose <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute is in the <a href="#image-button-state-(type=image)" title=attr-input-type-image>Image Button</a> state, and</li>
<ol><li><p>Let <var title="">sourced names</var> be an initially empty ordered list of tuples
consisting of a string, an element, a source, where the source is either <i>id</i>, <i>name</i>,
or <i>past</i>, and, if the source is <i>past</i>, an age.</li>

<li>The values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes of all the <code><a href=#the-img-element>img</a></code> elements that are
descendants of the <code><a href=#the-form-element>form</a></code> element, and</li>
<li>

<p>For each <a href=#category-listed title=category-listed>listed element</a> <var title="">candidate</var>
whose <a href=#form-owner>form owner</a> is the <code><a href=#the-form-element>form</a></code> element, with the exception of any
<code><a href=#the-input-element>input</a></code> elements whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the
<a href="#image-button-state-(type=image)" title=attr-input-type-image>Image Button</a> state, run these substeps:</p>

<ol><li><p>If <var title="">candidate</var> has an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute, add
an entry to <var title="">sourced names</var> with that <code title=attr-id><a href=#the-id-attribute>id</a></code>
attribute's value as the string, <var title="">candidate</var> as the element, and <i>id</i> as
the source.</li>

<li><p>If <var title="">candidate</var> has a <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attribute,
add an entry to <var title="">sourced names</var> with that <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attribute's value as the string, <var title="">candidate</var>
as the element, and <i>name</i> as the source.</li>

</ol></li>

<li>

<p>For each <code><a href=#the-img-element>img</a></code> element <var title="">candidate</var> that is a descendant of the
<code><a href=#the-form-element>form</a></code> element, run these substeps:</p>

<ol><li><p>If <var title="">candidate</var> has an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute, add
an entry to <var title="">sourced names</var> with that <code title=attr-id><a href=#the-id-attribute>id</a></code>
attribute's value as the string, <var title="">candidate</var> as the element, and <i>id</i> as
the source.</li>

<li><p>If <var title="">candidate</var> has a <code title=attr-img-name><a href=#attr-img-name>name</a></code> attribute,
add an entry to <var title="">sourced names</var> with that <code title=attr-img-name><a href=#attr-img-name>name</a></code> attribute's value as the string, <var title="">candidate</var>
as the element, and <i>name</i> as the source.</li>

</ol></li>

<li>

<p>For each entry <var title="">past entry</var> in the <a href=#past-names-map>past names map</a> add an entry
to <var title="">sourced names</var> with the <var title="">past entry</var>'s name as the
string, <var title="">past entry</var>'s element as the element, <i>past</i> as the source, and
the length of time <var title="">past entry</var> has been in the <a href=#past-names-map>past names map</a> as
the age.</p>

</li>

<li><p>Sort <var title="">sourced names</var> by <a href=#tree-order>tree order</a> of the element entry of
each tuple, sorting entries with the same element by putting entries whose source is <i>id</i>
first, then entries whose source is <i>name</i>, and finally entries whose source is <i>past</i>,
and sorting entries with the same element and source by their age, oldest first.</li>

<li>All the names currently in the <a href=#past-names-map>past names map</a>.</li>
<li><p>Remove any entries in <var title="">sourced names</var> that have the same name as an
earlier entry in the map.</li>

</ul><p>The values must be listed in <a href=#tree-order>tree order</a>, with <code title=attr-id><a href=#the-id-attribute>id</a></code>
attributes preceding <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes preceding entries from the
<a href=#past-names-map>past names map</a> when the same element has more than one, and with multiple entries in
the <a href=#past-names-map>past names map</a> for the same element being ordered chronologically by when they
were added to the map, and in all cases ignoring later duplicates.</p>
<li><p>Return the list of names from <var title="">sourced names</var>, maintaining their
relative order.</li>

<p>When a <code><a href=#the-form-element>form</a></code> element is <dfn id=dom-form-nameditem title=dom-form-namedItem>indexed for named property
</ol><p>When a <code><a href=#the-form-element>form</a></code> element is <dfn id=dom-form-nameditem title=dom-form-namedItem>indexed for named property
retrieval</dfn>, the user agent must run the following steps:</p>

<ol><li><p>Let <var title="">candidates</var> be a <a href=#live>live</a> <code><a href=#radionodelist>RadioNodeList</a></code>
Expand Down
72 changes: 58 additions & 14 deletions index
Expand Up @@ -44457,25 +44457,69 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<hr><!-- Welcome to crazy town. Population: The Web. --><p>Each <code><a href=#the-form-element>form</a></code> element has a mapping of names to elements called the <dfn id=past-names-map>past names
map</dfn>. It is used to persist names of controls even when they change names.</p>

<p>The <a href=#supported-property-names>supported property names</a> consist of:</p>
<p>The <a href=#supported-property-names>supported property names</a> consist of the names obtained from the following
algorithm, in the order obtained from this algorithm:</p>

<ul><li>The values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes of all the <a href=#category-listed title=category-listed>listed
elements</a> whose <a href=#form-owner>form owner</a> is the <code><a href=#the-form-element>form</a></code> element, with the
exception of <code><a href=#the-input-element>input</a></code> elements whose <code title=attr-input-type><a href=#attr-input-type>type</a></code>
attribute is in the <a href="#image-button-state-(type=image)" title=attr-input-type-image>Image Button</a> state, and</li>
<ol><li><p>Let <var title="">sourced names</var> be an initially empty ordered list of tuples
consisting of a string, an element, a source, where the source is either <i>id</i>, <i>name</i>,
or <i>past</i>, and, if the source is <i>past</i>, an age.</li>

<li>The values of all the <code title=attr-id><a href=#the-id-attribute>id</a></code> and <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes of all the <code><a href=#the-img-element>img</a></code> elements that are
descendants of the <code><a href=#the-form-element>form</a></code> element, and</li>
<li>

<p>For each <a href=#category-listed title=category-listed>listed element</a> <var title="">candidate</var>
whose <a href=#form-owner>form owner</a> is the <code><a href=#the-form-element>form</a></code> element, with the exception of any
<code><a href=#the-input-element>input</a></code> elements whose <code title=attr-input-type><a href=#attr-input-type>type</a></code> attribute is in the
<a href="#image-button-state-(type=image)" title=attr-input-type-image>Image Button</a> state, run these substeps:</p>

<ol><li><p>If <var title="">candidate</var> has an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute, add
an entry to <var title="">sourced names</var> with that <code title=attr-id><a href=#the-id-attribute>id</a></code>
attribute's value as the string, <var title="">candidate</var> as the element, and <i>id</i> as
the source.</li>

<li><p>If <var title="">candidate</var> has a <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attribute,
add an entry to <var title="">sourced names</var> with that <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attribute's value as the string, <var title="">candidate</var>
as the element, and <i>name</i> as the source.</li>

</ol></li>

<li>

<p>For each <code><a href=#the-img-element>img</a></code> element <var title="">candidate</var> that is a descendant of the
<code><a href=#the-form-element>form</a></code> element, run these substeps:</p>

<ol><li><p>If <var title="">candidate</var> has an <code title=attr-id><a href=#the-id-attribute>id</a></code> attribute, add
an entry to <var title="">sourced names</var> with that <code title=attr-id><a href=#the-id-attribute>id</a></code>
attribute's value as the string, <var title="">candidate</var> as the element, and <i>id</i> as
the source.</li>

<li><p>If <var title="">candidate</var> has a <code title=attr-img-name><a href=#attr-img-name>name</a></code> attribute,
add an entry to <var title="">sourced names</var> with that <code title=attr-img-name><a href=#attr-img-name>name</a></code> attribute's value as the string, <var title="">candidate</var>
as the element, and <i>name</i> as the source.</li>

</ol></li>

<li>

<p>For each entry <var title="">past entry</var> in the <a href=#past-names-map>past names map</a> add an entry
to <var title="">sourced names</var> with the <var title="">past entry</var>'s name as the
string, <var title="">past entry</var>'s element as the element, <i>past</i> as the source, and
the length of time <var title="">past entry</var> has been in the <a href=#past-names-map>past names map</a> as
the age.</p>

</li>

<li><p>Sort <var title="">sourced names</var> by <a href=#tree-order>tree order</a> of the element entry of
each tuple, sorting entries with the same element by putting entries whose source is <i>id</i>
first, then entries whose source is <i>name</i>, and finally entries whose source is <i>past</i>,
and sorting entries with the same element and source by their age, oldest first.</li>

<li>All the names currently in the <a href=#past-names-map>past names map</a>.</li>
<li><p>Remove any entries in <var title="">sourced names</var> that have the same name as an
earlier entry in the map.</li>

</ul><p>The values must be listed in <a href=#tree-order>tree order</a>, with <code title=attr-id><a href=#the-id-attribute>id</a></code>
attributes preceding <code title=attr-fe-name><a href=#attr-fe-name>name</a></code> attributes preceding entries from the
<a href=#past-names-map>past names map</a> when the same element has more than one, and with multiple entries in
the <a href=#past-names-map>past names map</a> for the same element being ordered chronologically by when they
were added to the map, and in all cases ignoring later duplicates.</p>
<li><p>Return the list of names from <var title="">sourced names</var>, maintaining their
relative order.</li>

<p>When a <code><a href=#the-form-element>form</a></code> element is <dfn id=dom-form-nameditem title=dom-form-namedItem>indexed for named property
</ol><p>When a <code><a href=#the-form-element>form</a></code> element is <dfn id=dom-form-nameditem title=dom-form-namedItem>indexed for named property
retrieval</dfn>, the user agent must run the following steps:</p>

<ol><li><p>Let <var title="">candidates</var> be a <a href=#live>live</a> <code><a href=#radionodelist>RadioNodeList</a></code>
Expand Down
86 changes: 69 additions & 17 deletions source
Expand Up @@ -48681,29 +48681,81 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {
<p>Each <code>form</code> element has a mapping of names to elements called the <dfn>past names
map</dfn>. It is used to persist names of controls even when they change names.</p>

<p>The <span>supported property names</span> consist of:</p>
<p>The <span>supported property names</span> consist of the names obtained from the following
algorithm, in the order obtained from this algorithm:</p>

<ul>
<ol>

<li>The values of all the <code title="attr-id">id</code> and <code
title="attr-fe-name">name</code> attributes of all the <span title="category-listed">listed
elements</span> whose <span>form owner</span> is the <code>form</code> element, with the
exception of <code>input</code> elements whose <code title="attr-input-type">type</code>
attribute is in the <span title="attr-input-type-image">Image Button</span> state, and</li>
<li><p>Let <var title="">sourced names</var> be an initially empty ordered list of tuples
consisting of a string, an element, a source, where the source is either <i>id</i>, <i>name</i>,
or <i>past</i>, and, if the source is <i>past</i>, an age.</p></li>

<li>The values of all the <code title="attr-id">id</code> and <code
title="attr-fe-name">name</code> attributes of all the <code>img</code> elements that are
descendants of the <code>form</code> element, and</li>
<li>

<li>All the names currently in the <span>past names map</span>.</li>
<p>For each <span title="category-listed">listed element</span> <var title="">candidate</var>
whose <span>form owner</span> is the <code>form</code> element, with the exception of any
<code>input</code> elements whose <code title="attr-input-type">type</code> attribute is in the
<span title="attr-input-type-image">Image Button</span> state, run these substeps:</p>

</ul>
<ol>

<li><p>If <var title="">candidate</var> has an <code title="attr-id">id</code> attribute, add
an entry to <var title="">sourced names</var> with that <code title="attr-id">id</code>
attribute's value as the string, <var title="">candidate</var> as the element, and <i>id</i> as
the source.</p></li>

<li><p>If <var title="">candidate</var> has a <code title="attr-fe-name">name</code> attribute,
add an entry to <var title="">sourced names</var> with that <code
title="attr-fe-name">name</code> attribute's value as the string, <var title="">candidate</var>
as the element, and <i>name</i> as the source.</p></li>

</ol>

</li>

<li>

<p>For each <code>img</code> element <var title="">candidate</var> that is a descendant of the
<code>form</code> element, run these substeps:</p>

<ol>

<p>The values must be listed in <span>tree order</span>, with <code title="attr-id">id</code>
attributes preceding <code title="attr-fe-name">name</code> attributes preceding entries from the
<span>past names map</span> when the same element has more than one, and with multiple entries in
the <span>past names map</span> for the same element being ordered chronologically by when they
were added to the map, and in all cases ignoring later duplicates.</p>
<li><p>If <var title="">candidate</var> has an <code title="attr-id">id</code> attribute, add
an entry to <var title="">sourced names</var> with that <code title="attr-id">id</code>
attribute's value as the string, <var title="">candidate</var> as the element, and <i>id</i> as
the source.</p></li>

<li><p>If <var title="">candidate</var> has a <code title="attr-img-name">name</code> attribute,
add an entry to <var title="">sourced names</var> with that <code
title="attr-img-name">name</code> attribute's value as the string, <var title="">candidate</var>
as the element, and <i>name</i> as the source.</p></li>

</ol>

</li>

<li>

<p>For each entry <var title="">past entry</var> in the <span>past names map</span> add an entry
to <var title="">sourced names</var> with the <var title="">past entry</var>'s name as the
string, <var title="">past entry</var>'s element as the element, <i>past</i> as the source, and
the length of time <var title="">past entry</var> has been in the <span>past names map</span> as
the age.</p>

</li>

<li><p>Sort <var title="">sourced names</var> by <span>tree order</span> of the element entry of
each tuple, sorting entries with the same element by putting entries whose source is <i>id</i>
first, then entries whose source is <i>name</i>, and finally entries whose source is <i>past</i>,
and sorting entries with the same element and source by their age, oldest first.</p></li>

<li><p>Remove any entries in <var title="">sourced names</var> that have the same name as an
earlier entry in the map.</p></li>

<li><p>Return the list of names from <var title="">sourced names</var>, maintaining their
relative order.</p></li>

</ol>

<p>When a <code>form</code> element is <dfn title="dom-form-namedItem">indexed for named property
retrieval</dfn>, the user agent must run the following steps:</p>
Expand Down

0 comments on commit 47d1310

Please sign in to comment.