[whatwg] Handling <title> inside <body>

On Mon, 10 Nov 2008 15:31:48 +0100, Tommy Thorsen <tommy at kvaleberg.com>  
wrote:

> Simon Pieters wrote:
>>> The description of the title element in the spec ("4.2.2 The title  
>>> element") says:
>>>
>>>     Contexts in which this element may be used:
>>>         In a head element containing no other title elements.
>>>
>>> I don't care very strongly about whether or not title elements are  
>>> allowed anywhere, but I do think the output of the parsing algorithm  
>>> should be valid html according to the rest of the spec.
>>
>> Why?
>>
> Hmm. Good question. If not, then why do we do foster parenting at all?

For Web compat. It's what browsers do. (IE and Opera don't foster parent  
but have magic <caption>-like elements around non-table content which  
makes it render pretty much the same.)


>  From an implementors point of view, it's good to have clearly defined  
> boundaries between modules. An implementation would typically have one  
> module that tokenises and parses html and one module that renders the  
> resulting dom to the screen. If all the unexpected input is dealt with  
> in the parsing module, then you can make some assumptions in the  
> rendering module which can greatly simplify the implementation. Having  
> to deal with an arbitrary amount of illegal input in either module is,  
> IMHO, not the ideal design.

When you support XHTML you'll have to deal with arbitrary trees anyway.  
And, actually, just with DOM and scripting you can end up with arbitrary  
trees.

-- 
Simon Pieters
Opera Software

Received on Monday, 10 November 2008 06:43:24 UTC