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

On Mon, 26 Mar 2001, Tantek Celik wrote:
>>>
>>> Note that in description in specifically said:
>>>
>>> "_If_ the property is set "
>>
>> Woah. It says "if the property is set *on a block-level element*".
>> (Emphasis mine).
>>
>> I interpret that to mean that "if you are looking at this property
>> on an element trying to work out what to do with it and you find
>> that element to be block level, then...".
>
> Nope. "if the property _is_set_" means something very different than
> "if you are looking at this property".

*Context*. "if the property is set _on_" means something very
different to "if the property _is_set_". The latter is redundant in
CSS, as per CSS2 section 6.1 [1]:

# Once a user agent has parsed a document and constructed a document
# tree, it must assign, for every element in the tree, a value to
# every property that applies to the target media type.


>> Anyway, there is no way in CSS to tell the difference between a
>> property that is never mentioned at any point in the stylesheet(s)
>> and one that is explicitly set to its initial value.
>
> I'm willing to accept that a subset of the CSS spec implies this,
> and therefore some implementations may have this limitation.

This is not a limitation, it is a fundamental axiom of the CSS model.
There is no difference between an element that has line-height
explicitly set to 'normal' through an author style sheet and one that
has line-height implicitly set to 'normal' through inheritance,
initial value, or the UA stylesheet.


> But, this is in direct contradiction with the "_is_set_" conditional
> which implies that there can be a different behavior if is "not
> set", which implies that that condition can occur.

The sentences "If I think I know the answer then x. If I don't think I
know the answer then y" do *not* imply that there is a possibility
that I may not think at all. (This is why the "er, I think, er," "you
think?!" joke is a joke!)

There is no "is set" conditional. The conditional is "is set on".


> Thus we have a contradiction that needs to be resolved.

There is no contradiction...


> In other words - I am stating the general principle that CSS default
> behaviors (call them initial values if you like) should be backward
> compatible with default traditional HTML rendering.

This is not the way things are. The CSS inline box model is but one of
many areas where the CSS spec is not "backwards compatible" with the
mutually incompatible renderings that existed before it. Other
examples include floats, font selection, font size selection,
backgrounds, underlining, and user preferences, to name but a few.

THIS IS NOT A PROBLEM.

At least three separate browser codebases have managed to cope with
this issue using DOCTYPE-derived modes (MacIE, N6, and the upcoming
Windows IE6).

The backwards compatible model is often rooted in ridiculous reverse
engineering feats that, while impressive in their own right, have very
littly logic involved.


> 'line-height:normal' should do what traditional HTML user agents do
> when formatting unstyled "lineboxes" as you say.

Modulo some minor disagreements of edge cases, CSS2 is very clear as
to how the inline box model should work. It is not fully backwards
compatible. That is no big deal; in fact it is why N6 shipped with two
completely different inline box model implementations: one that is
used in "quirks mode" and one that is used in "standard mode".


> if that is tough to define, then so be it. Nobody said it was
> supposed to be easy to work on a W3C specification.
>
> Yes, this may be difficult to define, but that's our job.

The "backwards compatible" inline box model includes "the last line of
the last LI in an OL should have the height of the parent's
'line-height'" [2]. If I see that in a W3C spec I will cry. :-/

-- References --
[1] http://www.w3.org/TR/REC-CSS2/cascade.html#q1
[2] WARNING: Mozilla source code is visible on this page!
    http://bugzilla.mozilla.org/show_bug.cgi?id=26998
    in particular David's comments dated 2000-02-11

-- 
Ian Hickson                                     )\     _. - ._.)       fL
Netscape, Standards Compliance QA              /. `- '  (  `--'
+1 650 937 6593                                `- , ) -> ) \
irc.mozilla.org:Hixie _________________________  (.' \) (.' -' __________

Received on Tuesday, 27 March 2001 18:50:24 UTC