Re: [CSS21] Issue 181 confusion over the height of inline-level boxes

On 25/03/2011 19:09, Bert Bos wrote:
> On Sunday 06 March 2011 19:13:13 Anton Prowse wrote:
>> On 04/03/2011 17:09, Bert Bos wrote:
>>> (See http://wiki.csswg.org/spec/css2.1#issue-181)
>>>
>>> The first list item in section 10.8 (Line height calculations: the
>>> 'line-height' and 'vertical-align' properties[1]) in the current
>>> draft
>>>
>>> says:
>>> |  1. The height of each inline-level box in the line box is
>>> |  calculated
>>> |
>>> |     (see "Calculating heights and margins" and the 'line-height'
>>> |     property).
>>>
>>> That is confusing, because the height is not the content height and
>>> you have to follow the links to know what height it actually is. I
>>> had an
>>>
>>> action to make this clear and this is my change:
>>>      1. 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'. (See
>>>         "Calculating heights and margins" and the height of inline
>>>         boxes in "Leading and half- leading".)
>>
>> But this contradicts your resolution to Issue 118 which is now in the
>> WD:
>>
>>     # 10.8.1 Leading and half-leading
>>     #
>>     # Still for each glyph, determine the leading L to add, where L =
>>     # line-height - AD. Half the leading is added above A and the other
>>     # half below D, giving the glyph and its leading a total height
> above
>>     # the baseline of A' = A + L/2 and a total depth of D' = D + L/2.
>>     #
>>     # The height of the inline box is then the smallest such that it
>>     # encloses all glyphs and their leading, as well as all nested
> inline
>>     # boxes.
>>
>> According to that, the height of a non-replaced inline box is the
>> minimum which encloses all glyphs and their leading (which, by
>> construction, is the value of 'line-height' even in cases of
>> fallbacks from other fonts) *and* encloses all nested inline boxes.
>> The latter isn't very clear; I suppose it means that, for each
>> nested inline box, it encloses the vertical extremities of the
>> rectangle whose height is equal to the height of the inline box (cf.
>> my concept of "guide boxes"). If so, the height of a non-replaced
>> inline box may certainly be bigger than its 'line-height'.
>
> We have since changed the last of the sentences you quoted so that the
> height of an inline box does *not* depend on child elements and is thus
> guaranteed to be 'line-height'. We needed that for issue 153[1], which
> requires a box of that height for 'vertical-align' to work on. You can
> see the new text in the snapshot[2].
>
> [1] http://wiki.csswg.org/spec/css2.1#issue-153
> [2] http://www.w3.org/Style/css2-updates/draft-PR-
> CSS21-201103XX/visudet.html#leading

Ah, I see.  Great!


>> Note that what the current WD says seems to be a change from what the
>> spec used to say (and still says) in 10.6.1:
>>
>>     # only the 'line-height' is used when calculating the height of the
>>     # line box.
>
> That is issue 281[3] and we improved the somewhat sloppy sentence to
> this:
>
>      The vertical padding, border and margin of an inline, non-replaced
>      box start at the top and bottom of the content area, and has nothing
>      to do with the 'line-height'. But only the 'line-height' is used
>      when calculating the height of the line box.[4]
>
> [3] http://wiki.csswg.org/spec/css2.1#issue-281
> [4] http://www.w3.org/Style/css2-updates/draft-PR-
> CSS21-201103XX/visudet.html#inline-non-replaced

Great.


> Does that close issue 181?

It does, thanks!


Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Sunday, 27 March 2011 09:11:40 UTC