Re: vertical-align and line-height

On Thursday 2009-02-26 13:09 -0600, David Hyatt wrote:
> Where is it specified that the half-leading should be included when  
> doing text-bottom/text-top alignment?  I couldn't find this in the spec.  
> If a font can be thought of as being broken into half-leading + ascent + 
> descent + half-leading, then WebKit is currently aligning to the top of 
> the ascent when text-top is specified and the bottom of the descent when 
> text-bottom is specified.  Is that wrong?  The result in WebKit makes 
> more sense to me than what I'm seeing in Firefox and Opera.

The definition of the value says:
# text-top
#   Align the top of the box with the top of the parent's content
#   area (see 10.6.1).

So this says to use the text metrics of the parent, but the "top of
the box" for the child, which includes half-leading for non-replaced
inlines.

Given the changes that we've made in CSS 2.1 (in which 10.6.1
defines the height of inline boxes in two different ways), I suppose
one could actually argue this is ambiguous, but if so I think it's
clearer in REC-CSS2 and that was an unintentional side-effect of CSS
2.1 editing that we should perhaps clarify.  That said, I think it's
still pretty clear, since throughout section 10.8 "height of the
box", etc., refer to values with half leading.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Thursday, 26 February 2009 19:17:45 UTC