<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>17831</bug_id>
          
          <creation_ts>2012-07-18 06:58:08 +0000</creation_ts>
          <short_desc>Form-associated elements with non-ancestor form owners should be reset when owner is removed from the tree</short_desc>
          <delta_ts>2012-09-26 22:09:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>adamk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>tkent</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>70132</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 06:58:08 +0000</bug_when>
    <thetext>This was was cloned from bug 16394 as part of operation convergence.
Originally filed: 2012-03-15 23:52:00 +0000
Original reporter: Adam Klein &lt;adamk@chromium.org&gt;

================================================================================
 #0   Adam Klein                                      2012-03-15 23:52:11 +0000 
--------------------------------------------------------------------------------
Created attachment 1102
Test case

In http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#attr-fae-form, I think a new line ought to be added to the rules governing when the form owner must be reset. Something on the order of:

&quot;When a tree containing a form-associated element and its form owner changes such that they are no longer in the same tree, reset the form owner of that element&quot;

This is to handle the case where the parser has caused a form control to be owned by a form which is not an ancestor. When that non-ancestor form is removed from the document, the form owner ought to be reset. It&apos;s not currently in WebKit (though after a GC it _is_ reset), but is in Firefox and Opera.

Test case attached.
================================================================================</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74593</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-26 22:05:48 +0000</bug_when>
    <thetext>adamk: Why isn&apos;t this handled by &quot;When an element is removed from a Document resulting in a form-associated element and its form owner (if any) no longer being in the same home subtree, then the user agent must reset the form owner of that form-associated element.&quot; ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74594</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Klein">adamk</who>
    <bug_when>2012-09-26 22:09:48 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; adamk: Why isn&apos;t this handled by &quot;When an element is removed from a Document
&gt; resulting in a form-associated element and its form owner (if any) no longer
&gt; being in the same home subtree, then the user agent must reset the form owner
&gt; of that form-associated element.&quot; ?

You&apos;re right, that takes care of it (marking as resolved). I think I must have missed how that sentence opens: &quot;When an element...&quot; rather than &quot;When a form-associated element...&quot; (as the rest of the sentences in that section do).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>