[whatwg] [wf2] 2.3. Changes to existing controls

Ian Hickson ian at hixie.ch
Mon Mar 21 04:23:52 PST 2005


On Mon, 21 Mar 2005, Anne van Kesteren wrote:
>
> # The children of a form element must be block-level elements, unless
> # one of the ancestors of the form element is a td, th, li, dd, dt, or
> # block-level element other than div, in which case either block-level
> # or inline-level content is allowed (but not both). input  elements of
> # type hidden may be placed anywhere (both in inline contexts and block
> # contexts).
> 
> Why does the content model of the FORM element have to be so difficult? 
> Why can't it be either block- or inline-level irrespective of its parent 
> element?

The main reason is to allow people to write markup like:


   <td>
    <form><input>...</form>
   </td>
   <td>
    <form><input>...</form>
   </td>

...instead of requiring:

   <td>
    <form>
     <p><input>...</p>
    </form>
   </td>
   <td>
    <form>
     <p><input>...</p>
    </form>
   </td>

...but without allowing:

   <body>
    <form>
     <input>...
    </form>
   </body>

In the table cell case there are semantics -- maybe the cell is part of a 
spreadsheet or something -- but in the <body> case the input doesn't have 
any particular semantics. It's not grouped into a thematic unit (like a 
paragraph or list). It's just... there. It would be like:

   <body>
    Hello world.
   </body>

...which is also not allowed.


> (Note also that the block- or inline-level model can't be described by a 
> DTD, only with a schema, but I don't believe that is a problem, is it?)

As noted in the WA1 draft, conformance checkers will need to be a lot more 
involved than schema- or DTD-based validators anyway.

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



More information about the whatwg mailing list