[CSS21] Meaning of line-height:normal (Re: line-height, problem?

> However, "normal" is not equivalent to "1".  It's equivalent to
> *something between 1 and 1.2*, where the exact value is
> implementation-defined.

The above is probably good enough to understanding the example in question,
but I think it's worth clarifying to give a better sense of the meaning of
line-height:normal in general.

The CSS 2.1 spec text is:

  # normal
  #   Tells user agents to set the used value to a "reasonable" value based
  #   on the font of the element. The value has the same meaning as <number>.
  #   We recommend a used value for 'normal' between 1.0 to 1.2.
  #   The computed value is 'normal'.

The main thing prompting me to post is that the "between 1.0 to 1.2"
sentence has confused a couple of implementers.  As is hinted by the spec
text, the used value isn't necessarily between 1 and 1.2.  The CSS2.1 spec
does recommend that the used value be in that range, but it isn't clear
how to balance that recommendation against other considerations such as
grid-fitting considerations or what the OpenType spec recommends.

In practice, the results vary across UAs (and across different platforms
of nominally the same UA), across font-families, and across font-sizes.
(In particular, the decision isn't based exclusively on the font of the
element.)  The result isn't always in the range 1 to 1.2.

Typographers will tell you that a "reasonable value" of line spacing
depends on things like the measure (the logical width of the block) and
the presence of subscripts, superscripts, inline mathematics etc.; and
might even go on to talk about higher-level principles such as alignment
across columns and pages.  I'd be surprised if any web browsers did any
of that, but a print-based UA written for book publishers might.
(I know of XSL-based software that does some this.)

It would be nice if the spec were clarified as to the intent of the
"between 1.0 to 1.2" sentence, and maybe even the "based on the font"
phrase (which might be read as excluding some reasonable considerations).


A minor point that might be pertinent to the surrounding discussion (which
involves inheritance) is that a specified value of 'normal' isn't equivalent
to any particular number; the computed value is 'normal', and elements that
inherit that value might have a differed used value from the parent.

pjrm.

Received on Wednesday, 28 November 2012 03:56:26 UTC