[whatwg] Children of form elements must be block level...

On Tue, 6 Jul 2004, dolphinling wrote:
>
> The Web Forms 2.0 spec says
>
> "The children of a form element must be block-level elements, unless one
> of the ancestors of the form element is a td, th, or block-level element
> other than div."
>
> 1. Why other than div?

In HTML4, the children of a form element must always be block-level.

However, that means that a cell or <li> would not be able to contain a
form that itself contained an <input>, even though the <li> could contain
one directly.

The assertion above is attempting to correct this, by allowing the
semantic of the ancestor to be propagated down.

However, <div> elements are semantic-free. So they have no semantics to
propagate. That is why they are excluded.


> 2. What if I style something (other than a td or th) as a table-cell?

The stylesheet has no effect on the allowed content models.


Thanks to your comment I did just notice that I'd omitted to mention LI
and DD elements though, so I'll fix that.

Cheers!
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 7 July 2004 08:48:22 UTC