W3C home > Mailing lists > Public > www-style@w3.org > October 2013

Re: line-height: normal and multiple descendant font sizes

From: Gérard Talbot <www-style@gtalbot.org>
Date: Fri, 18 Oct 2013 17:47:44 -0400
To: Glenn Adams <glenn@skynav.com>
Cc: W3C Style <www-style@w3.org>
Message-ID: <0b305f8b6d7143732843d4ac66be5916@gtalbot.org>
Le 2013-10-17 12:52, Glenn Adams a écrit :
> In CSS2.1, we have the following in Section 10.8.1:
> 
> "When an element contains text that is rendered in more than one font, 
> user
> agents may determine the 'normal'
> 'line-height'<http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height>
> value
> according to the largest font size."
> 

I think the spec with regards to section 10.8.1 should have been 
rather/instead saying something like:

"
When a single line box contains text that uses more than one font-size, 
user agents may determine the 'normal' 
'line-height'<http://www.w3.org/TR/CSS2/visudet.html#propdef-line-height> value according to the largest font size.
"

> I'm curious if any UA actually implements this. I have tested Chrome,
> Opera, and Safari UAs, and none of these UAs seems to use the largest 
> font
> size (of descendant fonts).
> 
> My test consisted of the following fragment:
> 
> <p style="line-height: normal">
> <span style="font-size: 12pt; border: 1px solid #C0C0C0">X</span></br>
> <span style="font-size: 36pt; border: 1px solid #C0C0C0">X</span></br>
> <span style="font-size: 18pt; border: 1px solid #C0C0C0">X</span></br>
> </p>

[snipped]

Here's a slightly modified version of your code fragment:

http://www.gtalbot.org/BrowserBugsSection/CSS3LineBox/multiple-line-box-various-font-sizes.html

The spans Z1, Z2, Z3 at the bottom is just to see what happens when 
there is only 1 single line box.

I think your test (expected rendered layout) is determined by section 
9.4.2 of CSS 2.1 and not by 10.8.1:

"
A line box is always tall enough for all of the boxes it contains. 
However, it may be taller than the tallest box it contains (if, for 
example, boxes are aligned so that baselines line up). When the height 
of a box B is less than the height of the line box containing it, the 
vertical alignment of B within the line box is determined by the 
'vertical-align' property. When several inline-level boxes cannot fit 
horizontally within a single line box, they are distributed among two or 
more vertically-stacked line boxes. Thus, a paragraph is a vertical 
stack of line boxes. Line boxes are stacked with no vertical separation 
(except as specified elsewhere) and they never overlap.
"

9.4.2 Inline formatting contexts
http://www.w3.org/TR/CSS21/visuren.html#inline-formatting
Received on Friday, 18 October 2013 21:48:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:03 UTC