Re: [css21] line-height, problem?

On Sunday 2012-11-25 23:21 -0800, Andrew Fedoniouk wrote:
> This sample:
> 
> https://dl.dropbox.com/u/14981836/line-height-test.htm
> 
> contains two identical paragraphs, the only difference is that
> first one has line-height:normal and second one - line-height:1em;
> 
> According to the spec [1]:
>    'line-height' specifies the *minimal* height of line boxes within
> the element.
> 
> If that property defines minimal height then these two paragraphs
> should be rendered in the same way. But all browsers I've tried render this
> sample with results I cannot interpret. The only exception is IE9, it treats
> as if 'line-height' defines max-line-height. That is also against the
> spec but at
> least the rendering is predictable somehow.
> 
> I suspect that I miss something between lines of the spec.
> My understanding of the spec wording is this:
> 
> used-line-height = max( {normal-line-height}, {defined-line-height} );
> 
> I'd appreciate any comments on the subject.

(1) when you're testing line-height, you should really test
standards mode rather than quirks mode; quirks mode behavior is
substantially different (and not fully explained by the first two
items in http://quirks.spec.whatwg.org/#css ).

(2) 'normal' and '1em' are *very* different in terms of how they
inherit when the font size changes (since '1em' inherits as the
computed value, which is no longer relative to the changed
descendent font size).  'normal' and '1' are much more similar.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂

Received on Monday, 26 November 2012 08:15:06 UTC