W3C home > Mailing lists > Public > whatwg@whatwg.org > January 2006

[whatwg] Tag Soup: Blocks-in-inlines

From: David Hyatt <hyatt@apple.com>
Date: Wed, 25 Jan 2006 18:06:08 -0800
Message-ID: <6E3DE545-9268-4B2C-8AE7-05CCF12A7E05@apple.com>
My 2 cents.

It took me a long time to develop an algorithm that actually fixed  
all 60 of the duplicate internal Apple bugs on this subject.  I'm  
reluctant to revisit this problem in our code base, given that my  
current algorithm was developed both to solve the problem and to be  
extremely performant and internally consistent.  For example,  
allowing blocks inside inlines minimizes the number of residual style  
tags that you have to re-open, and deferring the reopening of such  
tags until a misnested close tag is encountered ensures that well- 
formed documents don't end up with a bloated DOM.  Blocks inside  
inlines simply must be allowed.

Your DOM would grow unacceptably large on real-world pages if you try  
to restrict blocks from being inside inlines and end up reopening the  
inlines over and over again inside each block.  Not to mention that  
even without the residual style problem, sites rely on being able to  
nest blocks inside inlines (for example, an inline link that wraps  
multiple paragraphs but expects them to be a single link and not  
multiple links).

dave
(hyatt at apple.com)

On Jan 25, 2006, at 5:41 PM, Ian Hickson wrote:

> On Wed, 25 Jan 2006, Simon Pieters wrote:
>>
>> Thus, <em><p>XY</p></em> should be parsed as:
>>
>> BODY
>>   + EM
>>   + P
>>     + EM
>>       + #text: XY
>>
>> ...IMHO.
>
> This breaks in the face of <a><h3/><h3/></a>, sadly (see my earlier  
> mail).
> Otherwise I'd agree.
>
> -- 
> Ian Hickson               U+1047E                ) 
> \._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _ 
> \  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'-- 
> (,_..'`-.;.'
Received on Wednesday, 25 January 2006 18:06:08 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:25 UTC