Re: Formal definition of HTML5 (was Re: Version information)

David Dailey wrote:
> Let me see if I understand...
> 
> the (whatwg) spec says "Zero or more 
> <http://www.whatwg.org/specs/web-apps/current-work/#tbody>tbody 
> elements, or [...]"
> 
> The W3C spec says
> "The <http://www.w3.org/TR/html401/struct/tables.html#edef-TBODY>TBODY 
> start tag is always required except when the table contains only one 
> table body and no table head or foot sections. The 
> <http://www.w3.org/TR/html401/struct/tables.html#edef-TBODY>TBODY end 
> tag may always be safely omitted."
> 
> But when I look at document.getElementById(tableId).firstChild in Opera, 
> FF, or IE it is always a <tbody> , even if I did not code one there 
> myself. The browser inserts if for me. Does this mean those browsers are 
> doing it wrong?

For the HTML5 UA requirements see 
http://www.whatwg.org/specs/web-apps/current-work/multipage/section-tree-construction.html#in-table 
in particular the part which reads:

"""If the insertion mode is "in table"[...]

   > A start tag whose tag name is one of: "td", "th", "tr"

     Act as if a start tag token with the tag name "tbody" had been seen, then 
reprocess the current token."""

I believe HTML4 also requires that the tbody be present in the DOM but I'm not 
sure where it says that in the spec.

-- 
"Eternity's a terrible thought. I mean, where's it all going to end?"
  -- Tom Stoppard, Rosencrantz and Guildenstern are Dead

Received on Tuesday, 17 April 2007 16:19:19 UTC