This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28800 - Should 'reset form owner' be invoked on form-associated elements with no form owner when they are inserted into a subtree that is NOT IN the Document?
Summary: Should 'reset form owner' be invoked on form-associated elements with no form...
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other All
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#associa...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-12 03:59 UTC by contributor
Modified: 2017-07-24 10:32 UTC (History)
7 users (show)

See Also:


Attachments

Description contributor 2015-06-12 03:59:11 UTC
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 'reset form owner' 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
Comment 1 Mukilan Thiyagarajan 2015-06-12 04:16:53 UTC
The following script outputs 'true' on both Firefox 38 and Chrome 42:

<html>
<body>
</body>
<script>
    var form = document.createElement("form");
    var input = document.createElement("input");

    form.appendChild(input);
    console.log(input.form === form);
</script>
</html>

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

Specifically, the spec states that '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.'

But both FF and Chrome behave as though they invoke 'reset the form owner' whenever the parent of the element changes when the element currently has no form owner.
Comment 3 Ian 'Hixie' Hickson 2015-09-16 20:30:57 UTC
I don't understand. What about the text quoted in comment 1 requires that it be in a document?
Comment 4 James Graham 2015-09-16 20:39:08 UTC
If an element has no form owner then then it can't "no longer be in the same subtree" as that element (since it doesn't exist), so I don't think that text can be invoked to explain the behaviour of the testcase.
Comment 5 Anne 2017-07-24 10:32:44 UTC
Found even more weirdness here: https://github.com/whatwg/html/issues/2863.