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 16845 - Some algorithms in the HTML Parser must also override the "reset the form owner" (e.g., Adoption Agency algorithm)
Summary: Some algorithms in the HTML Parser must also override the "reset the form own...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Travis Leithead [MSFT]
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: CR
Depends on:
Blocks:
 
Reported: 2012-04-24 23:00 UTC by Travis Leithead [MSFT]
Modified: 2013-07-11 22:25 UTC (History)
7 users (show)

See Also:


Attachments

Description Travis Leithead [MSFT] 2012-04-24 23:00:02 UTC
We traced a real-world site issue [1] to an ambiguity in the HTML5 parsing spec regarding the magical "form owner". For a refresher, the HTML5 spec says:

4.10.18 >

| When a form-associated element's ancestor chain changes, e.g. because
| it or one of its ancestors was inserted or removed from a Document, 
| then the user agent must reset the form owner of that element. The 
| HTML parser overrides this requirement when inserting form controls.

...so, DOM operations that move elements around should reset the form owner. Cool. So, then what's the caveot with the HTML parser? It's here:

8.2.5.1 >

| If an element created by the insert an HTML element algorithm is a 
| form-associated element, and the form element pointer is not null, 
| and the newly created element doesn't have a form attribute, the 
| user agent must associate the newly created element with the form 
| element pointed to by the form element pointer when the element is 
| inserted, instead of running the reset the form owner algorithm.

...OK. This only identifies the "insert an HTML element algorithm" as meeting this requirement. This is what IE10 implemented. However, it turns out that the above exception is too narrow. 

4.10.18 should add that any algorithm employed by the HTML5 parser (such as the Adoption Agency algorithm), also overrides this behavior. Suggested text for the note:

"Note: The HTML parser overrides this requirement when inserting *or re-arranging* form controls, such as in the Adoption Agency algorithm."

The modified note above appears to match the behavior we are seeing currently in Firefox and Chrome, and is compatible with existing web content.

[1] http://www.elightbulbs.com/shopping_cart_process.cfm?action=pre_checkout
Comment 1 contributor 2012-07-18 07:01:45 UTC
This bug was cloned to create bug 17845 as part of operation convergence.
Comment 2 Edward O'Connor 2012-09-21 23:55:12 UTC
Travis, seeing as you reported this, would you like to take a stab at the spec change?
Comment 3 Travis Leithead [MSFT] 2012-09-24 18:45:09 UTC
I'll give it a shot. Thanks
Comment 4 Ian 'Hixie' Hickson 2013-02-12 23:20:25 UTC
Do you have precise steps to reproduce for this issue? I tried reproducing it but could not. See also bug 17845 comment 1.
Comment 5 Travis Leithead [MSFT] 2013-07-11 22:25:21 UTC
Per discussion on linked bug, deciding not to fix this to match Chrome behavior.