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

Hi,

From: Ian Hickson <ian@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

Received on Wednesday, 18 January 2006 16:12:48 UTC