Re: CSS 2: Table Cells and the "line-height" Property

From: Ian Hickson <ian@hixie.ch>
Subject: Re: CSS 2: Table Cells and the "line-height" Property
Date: Wed, Mar 28, 2001, 4:32 PM

> Clearly we have come to an impasse.

Clearly.

> Your argument (as I understand it) is that the spec means
>
>    "If the property is" explicitly "set" by the author "on" the
>    element you are looking at and if the element you are looking at is
>    "a block level element", then ...
>
> My argument is that the spec means
>
>    "If the property" on the element you are looking at "is" implicitly
>    or explicitly "set on a block level element", then...
>
> Your argument has no backing (as far as I can tell) in any other part
> of the spec. (Note that this is not necessarily a bad thing.)
>
> I believe my argument has the (weak) backing of CSS2 section 6.1, but
> you disagree that it is relevant, and I cannot easily counter that.

I believe this is an accurate summary of our points of view.

> Since I see no easy resolution to this, I will instead offer an
> alternative solution which should satisfy us both. I am assuming that
> your requirement is that the solution be able to provide a backwards
> compatible rendering when the author does not explicitly mention the
> 'line-height' property, regardless of backwards comparability modes.
> Similarly, my requirement is that the solution be within my
> interpretation of the spec.
>
> How about you define a new value of 'line-height', call it
> '-ms-normal', and you define your UA stylesheet to contain:
>
>    :root { line-height: -ms-normal; }
>
> You then define the behaviour of '-ms-normal' to be the backwards
> compatible inline box model.

How about we simply define the behavior of 'normal' to mean "vertically
shrink wrap the element", which is the traditional HTML presentation.  In
the case of a replaced or inline-block element, the vertical shrink wrap is
its height, and in the case of inline text, it behaves as line-height:1.0
does.

This goes along nicely with having the initial values of CSS properties
(since 'normal' is the initial value of 'line-height') approximate
traditional HTML presentation where possible.

The CSS1 sec.5.4.8 definition of 'line-height:normal' is:

 "A value of 'normal' sets the 'line-height' to a reasonable value for the
element's font. It is suggested that UAs set the 'normal' value to be a
number in the range of 1.0 to 1.2. "

This definition does not add any functionality.

A UA can simply represent this by something like:

 html { line-height:1.1 }

in its default style sheet.


Why not make the 'normal' value useful _and_ kindler/gentler to HTML
authors?


This solution also satisfies your point of view that every property always
has a value "set" on it.  Using your reasoning, if the property was not
explicitly set by an author, it would get the initial value of 'normal', and
thus behave as described.

The end result: no new values added to CSS, and better backwards
compatibility with a heavily relied upon and useful feature of traditional
HTML presentation.  IMHO this helps make it easier for authors to transition
from HTML markup based presentation to CSS styling based presentation.

Tantek

----------------------------------------------------------------------------
Instead, only try to realize the truth.     http://www.microsoft.com/mac/ie/

Received on Thursday, 29 March 2001 23:51:13 UTC