<?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>28800</bug_id>
          
          <creation_ts>2015-06-12 03:59:11 +0000</creation_ts>
          <short_desc>Should &apos;reset form owner&apos; be invoked on form-associated elements with no form owner when they are inserted into a subtree that is NOT IN the Document?</short_desc>
          <delta_ts>2017-07-24 10:32:44 +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>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>https://html.spec.whatwg.org/#association-of-controls-and-forms</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>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>james</cc>
    
    <cc>manishearth</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>mukilanthiagarajan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>120921</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2015-06-12 03:59:11 +0000</bug_when>
    <thetext>Specification: https://html.spec.whatwg.org/multipage/forms.html
Multipage: https://html.spec.whatwg.org/multipage/#association-of-controls-and-forms
Complete: https://html.spec.whatwg.org/#association-of-controls-and-forms
Referrer: https://html.spec.whatwg.org/multipage/

Comment:
Should &apos;reset form owner&apos; be invoked on form-associated elements with no form
owner when they are inserted into a subtree that is NOT IN the Document?

Posted from: 122.164.202.132
User agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120922</commentid>
    <comment_count>1</comment_count>
    <who name="Mukilan Thiyagarajan">mukilanthiagarajan</who>
    <bug_when>2015-06-12 04:16:53 +0000</bug_when>
    <thetext>The following script outputs &apos;true&apos; on both Firefox 38 and Chrome 42:

&lt;html&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;script&gt;
    var form = document.createElement(&quot;form&quot;);
    var input = document.createElement(&quot;input&quot;);

    form.appendChild(input);
    console.log(input.form === form);
&lt;/script&gt;
&lt;/html&gt;

However, according to the spec, none of the conditions to invoke &apos;reset the form owner&apos; are satisfied and hence &apos;input.form&apos; must be &apos;null&apos;.

Specifically, the spec states that &apos;When an element changes its parent node 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.&apos;

But both FF and Chrome behave as though they invoke &apos;reset the form owner&apos; whenever the parent of the element changes when the element currently has no form owner.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120927</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2015-06-12 08:40:41 +0000</bug_when>
    <thetext>http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3537</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123232</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2015-09-16 20:30:57 +0000</bug_when>
    <thetext>I don&apos;t understand. What about the text quoted in comment 1 requires that it be in a document?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123234</commentid>
    <comment_count>4</comment_count>
    <who name="James Graham">james</who>
    <bug_when>2015-09-16 20:39:08 +0000</bug_when>
    <thetext>If an element has no form owner then then it can&apos;t &quot;no longer be in the same subtree&quot; as that element (since it doesn&apos;t exist), so I don&apos;t think that text can be invoked to explain the behaviour of the testcase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128778</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2017-07-24 10:32:44 +0000</bug_when>
    <thetext>Found even more weirdness here: https://github.com/whatwg/html/issues/2863.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>