Skip to content

Commit

Permalink
[giow] (3) Turns out browsers reset the form owner not just when a no…
Browse files Browse the repository at this point in the history
…de is taken from a document, but also when it's taken from a subtree. which makes sense.

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

git-svn-id: http://svn.whatwg.org/webapps@8446 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 30, 2014
1 parent 82ace97 commit d113f4c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
16 changes: 9 additions & 7 deletions complete.html
Expand Up @@ -38223,10 +38223,9 @@ <h4 id=categories><span class=secno>4.10.2 </span>Categories</h4>
<a href=#reflect>reflect</a> the <code title=attr-form-accept-charset><a href=#attr-form-accept-charset>accept-charset</a></code> content
attribute.</p>

<hr><p>The <dfn id=dom-form-elements title=dom-form-elements><code>elements</code></dfn> IDL attribute must return an
<code><a href=#htmlformcontrolscollection>HTMLFormControlsCollection</a></code> rooted at the <code><a href=#document>Document</a></code> node while the
<code><a href=#the-form-element>form</a></code> element is <a href=#in-a-document>in a <code>Document</code></a> and rooted at the
<code><a href=#the-form-element>form</a></code> element itself when it is not, whose filter matches <a href=#category-listed title=category-listed>listed elements</a> whose <a href=#form-owner>form owner</a> is the
<hr><!--CLEANUP--><p>The <dfn id=dom-form-elements title=dom-form-elements><code>elements</code></dfn> IDL attribute must return an
<code><a href=#htmlformcontrolscollection>HTMLFormControlsCollection</a></code> rooted at the
<code><a href=#the-form-element>form</a></code> element's <a href=#home-subtree>home subtree</a>'s <a href=#root-element>root element</a>, whose filter matches <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, which must, for historical reasons, be excluded from this particular
collection.</p>
Expand Down Expand Up @@ -47205,6 +47204,7 @@ <h5 id=association-of-controls-and-forms><span class=secno>4.10.18.3 </span>Asso
<p class=note>This feature allows authors to work around the lack of support for nested
<code><a href=#the-form-element>form</a></code> elements.</p>

<!--CLEANUP-->
<p>If a <a href=#category-form-attr title=category-form-attr>reassociateable</a> <a href=#form-associated-element>form-associated
element</a> has a <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute specified, then that
attribute's value must be the <a href=#concept-id title=concept-id>ID</a> of a <code><a href=#the-form-element>form</a></code> element in
Expand All @@ -47222,6 +47222,7 @@ <h5 id=association-of-controls-and-forms><span class=secno>4.10.18.3 </span>Asso
<p>When a <a href=#form-associated-element>form-associated element</a> is created, its <a href=#form-owner>form owner</a> must be
initialized to null (no owner).</p>

<!--CLEANUP-->
<p>When a <a href=#form-associated-element>form-associated element</a> is to be <dfn id=concept-form-association title=concept-form-association>associated</dfn> with a form, its <a href=#form-owner>form owner</a> must be
set to that form.</p>

Expand All @@ -47230,8 +47231,8 @@ <h5 id=association-of-controls-and-forms><span class=secno>4.10.18.3 </span>Asso
<a href=#reset-the-form-owner>reset the form owner</a> of that <a href=#form-associated-element>form-associated element</a>. <span class=note>The <a href=#html-parser>HTML parser</a> overrides this requirement when inserting form
controls.</span></p>

<p>When an element is <a href=#remove-an-element-from-a-document title="remove an element from a document">removed from a
<code>Document</code></a> resulting in a <a href=#form-associated-element>form-associated element</a> and its
<!--CLEANUP-->
<p>When an element changes its parent node resulting in a <a href=#form-associated-element>form-associated element</a> and its
<a href=#form-owner>form owner</a> (if any) no longer being in the same <a href=#home-subtree>home subtree</a>, then the
user agent must <a href=#reset-the-form-owner>reset the form owner</a> of that <a href=#form-associated-element>form-associated
element</a>.</p>
Expand All @@ -47240,6 +47241,7 @@ <h5 id=association-of-controls-and-forms><span class=secno>4.10.18.3 </span>Asso
element</a>'s <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute is set, changed, or removed,
then the user agent must <a href=#reset-the-form-owner>reset the form owner</a> of that element.</p>

<!--CLEANUP-->
<p>When a <a href=#category-form-attr title=category-form-attr>reassociateable</a> <a href=#form-associated-element>form-associated
element</a> has a <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute and the <a href=#concept-id title=concept-id>ID</a> of any of the elements in the <code><a href=#document>Document</a></code> changes, then the
user agent must <a href=#reset-the-form-owner>reset the form owner</a> of that <a href=#form-associated-element>form-associated
Expand All @@ -47255,7 +47257,7 @@ <h5 id=association-of-controls-and-forms><span class=secno>4.10.18.3 </span>Asso
<p>When the user agent is to <dfn id=reset-the-form-owner>reset the form owner</dfn> of a <a href=#form-associated-element>form-associated
element</a>, it must run the following steps:</p>

<ol><li><p>If the element's <a href=#form-owner>form owner</a> is not null, and either the element is not <a href=#category-form-attr title=category-form-attr>reassociateable</a> or its <code title=attr-fae-form><a href=#attr-fae-form>form</a></code>
<ol><!--CLEANUP--><li><p>If the element's <a href=#form-owner>form owner</a> is not null, and either the element is not <a href=#category-form-attr title=category-form-attr>reassociateable</a> or its <code title=attr-fae-form><a href=#attr-fae-form>form</a></code>
content attribute is not present, and the element's <a href=#form-owner>form owner</a> is its nearest
<code><a href=#the-form-element>form</a></code> element ancestor after the change to the ancestor chain, then do nothing, and
abort these steps.</li>
Expand Down
16 changes: 9 additions & 7 deletions index
Expand Up @@ -38223,10 +38223,9 @@ interface <dfn id=htmlformelement>HTMLFormElement</dfn> : <a href=#htmlelement>H
<a href=#reflect>reflect</a> the <code title=attr-form-accept-charset><a href=#attr-form-accept-charset>accept-charset</a></code> content
attribute.</p>

<hr><p>The <dfn id=dom-form-elements title=dom-form-elements><code>elements</code></dfn> IDL attribute must return an
<code><a href=#htmlformcontrolscollection>HTMLFormControlsCollection</a></code> rooted at the <code><a href=#document>Document</a></code> node while the
<code><a href=#the-form-element>form</a></code> element is <a href=#in-a-document>in a <code>Document</code></a> and rooted at the
<code><a href=#the-form-element>form</a></code> element itself when it is not, whose filter matches <a href=#category-listed title=category-listed>listed elements</a> whose <a href=#form-owner>form owner</a> is the
<hr><!--CLEANUP--><p>The <dfn id=dom-form-elements title=dom-form-elements><code>elements</code></dfn> IDL attribute must return an
<code><a href=#htmlformcontrolscollection>HTMLFormControlsCollection</a></code> rooted at the
<code><a href=#the-form-element>form</a></code> element's <a href=#home-subtree>home subtree</a>'s <a href=#root-element>root element</a>, whose filter matches <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, which must, for historical reasons, be excluded from this particular
collection.</p>
Expand Down Expand Up @@ -47205,6 +47204,7 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
<p class=note>This feature allows authors to work around the lack of support for nested
<code><a href=#the-form-element>form</a></code> elements.</p>

<!--CLEANUP-->
<p>If a <a href=#category-form-attr title=category-form-attr>reassociateable</a> <a href=#form-associated-element>form-associated
element</a> has a <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute specified, then that
attribute's value must be the <a href=#concept-id title=concept-id>ID</a> of a <code><a href=#the-form-element>form</a></code> element in
Expand All @@ -47222,6 +47222,7 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
<p>When a <a href=#form-associated-element>form-associated element</a> is created, its <a href=#form-owner>form owner</a> must be
initialized to null (no owner).</p>

<!--CLEANUP-->
<p>When a <a href=#form-associated-element>form-associated element</a> is to be <dfn id=concept-form-association title=concept-form-association>associated</dfn> with a form, its <a href=#form-owner>form owner</a> must be
set to that form.</p>

Expand All @@ -47230,8 +47231,8 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
<a href=#reset-the-form-owner>reset the form owner</a> of that <a href=#form-associated-element>form-associated element</a>. <span class=note>The <a href=#html-parser>HTML parser</a> overrides this requirement when inserting form
controls.</span></p>

<p>When an element is <a href=#remove-an-element-from-a-document title="remove an element from a document">removed from a
<code>Document</code></a> resulting in a <a href=#form-associated-element>form-associated element</a> and its
<!--CLEANUP-->
<p>When an element changes its parent node resulting in a <a href=#form-associated-element>form-associated element</a> and its
<a href=#form-owner>form owner</a> (if any) no longer being in the same <a href=#home-subtree>home subtree</a>, then the
user agent must <a href=#reset-the-form-owner>reset the form owner</a> of that <a href=#form-associated-element>form-associated
element</a>.</p>
Expand All @@ -47240,6 +47241,7 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
element</a>'s <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute is set, changed, or removed,
then the user agent must <a href=#reset-the-form-owner>reset the form owner</a> of that element.</p>

<!--CLEANUP-->
<p>When a <a href=#category-form-attr title=category-form-attr>reassociateable</a> <a href=#form-associated-element>form-associated
element</a> has a <code title=attr-fae-form><a href=#attr-fae-form>form</a></code> attribute and the <a href=#concept-id title=concept-id>ID</a> of any of the elements in the <code><a href=#document>Document</a></code> changes, then the
user agent must <a href=#reset-the-form-owner>reset the form owner</a> of that <a href=#form-associated-element>form-associated
Expand All @@ -47255,7 +47257,7 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
<p>When the user agent is to <dfn id=reset-the-form-owner>reset the form owner</dfn> of a <a href=#form-associated-element>form-associated
element</a>, it must run the following steps:</p>

<ol><li><p>If the element's <a href=#form-owner>form owner</a> is not null, and either the element is not <a href=#category-form-attr title=category-form-attr>reassociateable</a> or its <code title=attr-fae-form><a href=#attr-fae-form>form</a></code>
<ol><!--CLEANUP--><li><p>If the element's <a href=#form-owner>form owner</a> is not null, and either the element is not <a href=#category-form-attr title=category-form-attr>reassociateable</a> or its <code title=attr-fae-form><a href=#attr-fae-form>form</a></code>
content attribute is not present, and the element's <a href=#form-owner>form owner</a> is its nearest
<code><a href=#the-form-element>form</a></code> element ancestor after the change to the ancestor chain, then do nothing, and
abort these steps.</li>
Expand Down
14 changes: 9 additions & 5 deletions source
Expand Up @@ -41689,10 +41689,10 @@ interface <dfn>HTMLFormElement</dfn> : <span>HTMLElement</span> {

<hr>

<!--CLEANUP-->
<p>The <dfn data-x="dom-form-elements"><code>elements</code></dfn> IDL attribute must return an
<code>HTMLFormControlsCollection</code> rooted at the <code>Document</code> node while the
<code>form</code> element is <span>in a <code>Document</code></span> and rooted at the
<code>form</code> element itself when it is not, whose filter matches <span
<code>HTMLFormControlsCollection</code> rooted at the
<code>form</code> element's <span>home subtree</span>'s <span>root element</span>, whose filter matches <span
data-x="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
data-x="attr-input-type">type</code> attribute is in the <span data-x="attr-input-type-image">Image
Expand Down Expand Up @@ -51824,6 +51824,7 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>
<p class="note">This feature allows authors to work around the lack of support for nested
<code>form</code> elements.</p>

<!--CLEANUP-->
<p>If a <span data-x="category-form-attr">reassociateable</span> <span>form-associated
element</span> has a <code data-x="attr-fae-form">form</code> attribute specified, then that
attribute's value must be the <span data-x="concept-id">ID</span> of a <code>form</code> element in
Expand All @@ -51841,6 +51842,7 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>
<p>When a <span>form-associated element</span> is created, its <span>form owner</span> must be
initialized to null (no owner).</p>

<!--CLEANUP-->
<p>When a <span>form-associated element</span> is to be <dfn
data-x="concept-form-association">associated</dfn> with a form, its <span>form owner</span> must be
set to that form.</p>
Expand All @@ -51851,8 +51853,8 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>
class="note">The <span>HTML parser</span> overrides this requirement when inserting form
controls.</span></p>

<p>When an element is <span data-x="remove an element from a document">removed from a
<code>Document</code></span> resulting in a <span>form-associated element</span> and its
<!--CLEANUP-->
<p>When an element changes its parent node resulting in a <span>form-associated element</span> and its
<span>form owner</span> (if any) no longer being in the same <span>home subtree</span>, then the
user agent must <span>reset the form owner</span> of that <span>form-associated
element</span>.</p>
Expand All @@ -51861,6 +51863,7 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>
element</span>'s <code data-x="attr-fae-form">form</code> attribute is set, changed, or removed,
then the user agent must <span>reset the form owner</span> of that element.</p>

<!--CLEANUP-->
<p>When a <span data-x="category-form-attr">reassociateable</span> <span>form-associated
element</span> has a <code data-x="attr-fae-form">form</code> attribute and the <span
data-x="concept-id">ID</span> of any of the elements in the <code>Document</code> changes, then the
Expand All @@ -51879,6 +51882,7 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>

<ol>

<!--CLEANUP-->
<li><p>If the element's <span>form owner</span> is not null, and either the element is not <span
data-x="category-form-attr">reassociateable</span> or its <code data-x="attr-fae-form">form</code>
content attribute is not present, and the element's <span>form owner</span> is its nearest
Expand Down

0 comments on commit d113f4c

Please sign in to comment.