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 17831 - Form-associated elements with non-ancestor form owners should be reset when owner is removed from the tree
Summary: Form-associated elements with non-ancestor form owners should be reset when o...
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 06:58 UTC by contributor
Modified: 2012-09-26 22:09 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2012-07-18 06:58:08 UTC
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 <adamk@chromium.org>

================================================================================
 #0   Adam Klein                                      2012-03-15 23:52:11 +0000 
--------------------------------------------------------------------------------
Created attachment 1102 [details]
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:

"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"

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's not currently in WebKit (though after a GC it _is_ reset), but is in Firefox and Opera.

Test case attached.
================================================================================
Comment 1 Ian 'Hixie' Hickson 2012-09-26 22:05:48 UTC
adamk: Why isn't this handled by "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." ?
Comment 2 Adam Klein 2012-09-26 22:09:48 UTC
(In reply to comment #1)
> adamk: Why isn't this handled by "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." ?

You're right, that takes care of it (marking as resolved). I think I must have missed how that sentence opens: "When an element..." rather than "When a form-associated element..." (as the rest of the sentences in that section do).