W3C home > Mailing lists > Public > public-html@w3.org > December 2008

Re: Don't make <h1><h1> nest

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 2 Dec 2008 02:36:28 +0000 (UTC)
To: Simon Pieters <simonp@opera.com>
Cc: public-html <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0812020227390.17414@hixie.dreamhostps.com>

On Mon, 13 Oct 2008, Simon Pieters wrote:
> 
> http://html5.org/tools/web-apps-tracker?from=925&to=926
> 
> In order to get the layout right, what is actually needed is a unit that 
> acts like 'em' but ignores ancestor h1-h6 elements when calculating the 
> computed style of font-size. Using 'rem' or similar isn't good enough 
> because pages can set the font-size on root to something that isn't used 
> for the actual text on the page, or some pages have a sidebar in a 
> smaller font, etc.
> 
> So we've decided to do what webkit does. (Any element in between whose 
> end tag isn't implied by <h1> makes them nest.)

Oops, the spec was intended to match what WebKit did here, but I missed 
the case of direct nesting. Fixed.


On Mon, 13 Oct 2008, Simon Pieters wrote:
> 
> What about <h1><p><font><h2>x
> 
> I'm tempted to say that the <h2> should cause the imply-end-tag-for-p 
> rules to be followed, so that the h1 is at the top of the stack (or is 
> it bottom?), and so the tree would be
> 
> <h1>
>   <p>
>     <font>
> <h2>
>   <font>
>     "x"
> 
> But I'm not sure.

Yeah, that's what the spec says now (because it checks for h1-h6 after 
closing <p>s).



> PS. It seems that in webkit, <p><font><h2>x is parsed into
> 
> <p>
>   <font>
>     <h2>
>       "x"
> 
> and <p><font><p>x is parsed into
> 
> <p>
>   <font>
> <font>
>   <p>
>     "x"
> 
> which causes less elements in the tree than the spec for
> <p><u><u><u><p>x<p>x<p>x...

Yeah, but compare:

    <h1><p><font color=navy><h2>x</font>y

    <h1><span><p><font color=navy><h2>x</font>y

There are always edge cases where one algorithm beats another; the spec 
beats webkit's (less cloning) in the case of inlines being opened outside 
blocks and closed inside blocks, as in:

   <p><i>...<p>...</i>

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 2 December 2008 02:37:06 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:59 UTC