[whatwg] Allow <form> as a child of <tbody>

Simon Pieters zcorpan at hotmail.com
Wed Jan 18 16:12:48 PST 2006


Hi,

From: Ian Hickson <ian at hixie.ch>
>Check the DOM for that markup. "Backwards compatible" is not the words I
>would use...

I did some more testing[1] on this. It seems that in Mozilla and Opera, the 
DOM tree for...

   <table><tbody><form><tr><td><input></td></tr></form></tbody></table>

...looks like this:

TABLE
- TBODY
- - FORM
- - TR
- - - TD
- - - - INPUT

In IE6 the DOM tree looks like this:

TABLE
- TBODY
- - FORM
- - - TR
- - - - TD
- - - - - INPUT

Even though the FORM is not an ancestor to the INPUT in the DOM tree in 
Mozilla or Opera, the DOM2 HTML attributes .form and .elements work as if it 
was. The same holds true when <form> is placed as a child of TABLE, TBODY 
(presumably also THEAD and TFOOT), and TR.

(Given that this works in Mozilla and Opera even though the FORM is not an 
ancestor of the INPUT, gives me a feeling that it wouldn't be impossible to 
implement form="". Indeed, form="" is already implemented in Opera 9 build 
8031, if I'm not mistaken.)

[1] http://zcorpan.1go.dk/test/html/table-form/

Regards,
Simon Pieters





More information about the whatwg mailing list