W3C home > Mailing lists > Public > www-style@w3.org > November 2012

RE: [css21] line-height, problem?

From: Stephen Zilles <szilles@adobe.com>
Date: Mon, 26 Nov 2012 16:12:53 -0800
To: Andrew Fedoniouk <news@terrainformatica.com>, "www-style@gtalbot.org" <www-style@gtalbot.org>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <CE2F61DA5FA23945A4EA99A212B157957193C4DA67@nambx03.corp.adobe.com>
Andrew,
My understanding of the text that you reference is that minimal means that no line within the block will have a line height of less than the line-height of the block. It seems to me that your test case shows exactly that. Did you have something else in mind?

Steve Zilles

-----Original Message-----
From: a.fedoniouk@gmail.com [mailto:a.fedoniouk@gmail.com] On Behalf Of Andrew Fedoniouk
Sent: Monday, November 26, 2012 4:01 PM
To: www-style@gtalbot.org
Cc: www-style@w3.org
Subject: Re: [css21] line-height, problem?

Hmm, seems like my understanding of word "minimal" is completely wrong.

Consider this very simple doc:
https://dl.dropbox.com/u/14981836/line-height-test-min.htm

At the moment the spec[1] says:

"On a block container element whose content is composed of inline-level elements, 'line-height' specifies the minimal height of line boxes within the element."

But UAs render this example as if 'line-height' specifies not the minimal height but just height of line boxes.

Either spec is wrong with use of "minimal" there or UAs are wrong all together.

[1] http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height

--
Andrew Fedoniouk.

http://terrainformatica.com

On Mon, Nov 26, 2012 at 11:18 AM, "Gérard Talbot" <www-style@gtalbot.org> wrote:
>
> Le Lun 26 novembre 2012 13:51, Andrew Fedoniouk a écrit :
>> On Mon, Nov 26, 2012 at 12:14 AM, L. David Baron <dbaron@dbaron.org>
>> wrote:
>>> 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.
>>>>
>> ...
>>>>
>>>> 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} 
>>>> );
>>>>
>>>
>>> (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
>>>
>>
>> Thanks, David. I've updated the sample with HTML5 doctype.
>> That actually makes no difference (only IE started to match all other 
>> UAs here).
>>
>> In fact I've missed that part in the spec:
>> "On a non-replaced inline element, 'line-height' specifies the height 
>> that is used in the calculation of the line box height."
>
> Right here, the "calculation of the line box height" should be a link 
> to
>
> http://www.w3.org/TR/CSS21/visudet.html#line-height
>
> And the sentence itself is not easy to figure out. It should be saying
> instead/rather:
>
> "On a non-replaced inline element, 'line-height' specifies its height 
> which will be used in the calculation of the line box height."
>
> because
>
> "
> The height of each inline-level box in the line box is calculated. For 
> replaced elements, inline-block elements, and inline-table elements, 
> this is the height of their margin box; for inline boxes, this is 
> their 'line-height'.
> "
> http://www.w3.org/TR/CSS21/visudet.html#line-height
>
>>
>> So for such elements (like <big> in my sample) line-height defines 
>> not "min-line-height" but just 'line-height' allowing to reduce it.
>> Together with the fact that line-height is an inheritable property 
>> that creates such strange effect.
>
> Not sure what you're trying to say... but I definitely agree with you 
> that this part of the spec - without useful diagrams and judicious 
> explaining schemas - is difficult to visualize, to conceptualize.
>
> Gérard
> --
> CSS 2.1 Test suite RC6, March 23rd 2011 
> http://test.csswg.org/suites/css2.1/20110323/html4/toc.html
>
> Contributions to CSS 2.1 test suite
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/
>
> Web authors' contributions to CSS 2.1 test suite 
> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-c
> ontributions-css21-testsuite.html
>
Received on Tuesday, 27 November 2012 00:13:25 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT