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

[whatwg] Tag Soup: Blocks-in-inlines

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Thu, 26 Jan 2006 00:15:58 +1100
Message-ID: <43D77A0E.1070109@lachy.id.au>
Simon Pieters wrote:
> Hi,
> 
> From: Lachlan Hunt <lachlan.hunt at lachy.id.au>
>> However, there may be a 5th option available.  Consider this, using 
>> the following markup samples from the article.
>>
>> 1.
>> <em><p>X</em>Y</p>
>>
>> BODY
>>   + P
>>     + EM
>>       + #text: X
>>     + #text: Y
> 
> Why would you drop the first EM? Why should this be parsed any different 
> than 4? I think it should look like this instead:

Because there were no text nodes between the <em> start-tag and the <p> 
start tag, so putting it in there would be completely redundant and 
useless.  Although putting it there will have no detrimental effect 
beyond wasting a minuscule amount of memory, so it really doesn't matter.

>> 2.
>> <em><p>XY</p></em>
>>
>> BODY
>>   + P
>>     + EM
>>       + #text: X
>>       + #text: Y
> 
> Why are there two text nodes?

Copy & paste error.

> I don't think there's much advantage of differentiating between 
> "well-formed" and "malformed" markup. They should be parsed the same to 
> keep things simple and predictable. Thus, <em><p>XY</p></em> should be 
> parsed as:
> 
> BODY
>   + EM
>   + P
>     + EM
>       + #text: XY
> 
> ...IMHO.

Agree; but again, the empty EM element is redundant.

-- 
Lachlan Hunt
http://lachy.id.au/
Received on Wednesday, 25 January 2006 05:15:58 UTC

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