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

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'.

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.

Moreover, I'm suspicious that the new text for 10.8.1 doesn't have 
browser support / interop (since it's a significant change to what the 
spec used to imply) but I haven't tested that yet.

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

Received on Sunday, 6 March 2011 18:13:49 UTC