[www-style] <none>

--- Ian Hickson <py8ieh@bath.ac.uk> wrote:
> On Sat, 15 Jan 2000, Erik van der Poel wrote:
> > 5. underline. Fonts usually have a recommended underline position
> > and thickness. However, if we draw the underlines for the various
> > font boxes at various positions and thicknesses, it won't look so
> > good. [...]
> 
> It would also be wrong. Underlines should be drawn *for the outer
> element only*. i.e., the one with "text-decoration:underline". The
> underline just happens to span the children -- it should not be drawn
> *by* the children.
> 
> This is why...
> # [... the] color of decorations should remain the same even if
> # descendant elements have different 'color' values.

This (viz. that t-d spans children) was the interpretation of the spec
that I at one time held. However, closer scrutiny of the spec reveals that
this is wrong.

It says:
If the property is specified for a block-level element, it affects all
inline-level descendants of the element. If it is specified for (or
affects) an inline-level element, it affects all boxes generated by the
element.

Now 'affects' is not the same as 'spans', and I find that 'spans' doesn't
give good results. As regards compliant implementations of this, I find
that Mozilla (which implements 'affects) comes pretty close. Opera (3.*),
which implements 'spans' misses by a mile.

> 
>    +-------+========+-------+
>    | Hello | Lovely | World |
>    +-------+========+-------+
> 
> The underlining should (as I understand it) be applied *to the outer
> inline box* only. That is why, for example, the colour is the same
> throughout an underlining.

I think it is actually more complicated than this.

I think the correct interpretation of 'affects' is 'apply normally, but
according to the ancestor value'.
For example, P {text-decoration: underline; color: red}
SPAN {color: green}
applies the _type_ of decoration implied by the element on which it was
specified, but at the _position_ implied by the element on which it is
actually being applied.

I do however think that there are difficulties relating to the height of
the t-dec.

> 
> Another way of testing this: if you made the inner span invisible
> (using the visibility property), the underlining should remain.
Hmm. Interesting.
I would say not - the t-dec is associated with the SPAN but its
characteristics are specified by the ancestor; therefore, suppression of
the SPAN must suppress the t-dec on it [?????]
> 
> Yet another example -- in the case of the following fragment:
> 
>    <span style="text-decoration:overline" id="a">
>      Outer
>        <span style="font-weight:bold;" id="b"> Inner </span>
>      Outer
>    </span>
> 
> ...the element 'a' should render the overline:
>     ___________________
>      Outer       Outer
> 
> ...and the element 'b' should merely render its text:
> 
>            Inner
> 
> ...which will result in:
>     ___________________
>      Outer Inner Outer
> 
> Thus the overline above 'Inner' is not any bolder than the rest.
Again, I don't think this interpretation can stand with the spec.
[and more on same lines snipped]


=====
----------------------------------------------------------
From Matthew Brealey (http://members.tripod.co.uk/lawnet (for law)or http://members.tripod.co.uk/lawnet/WEBFRAME.HTM (for CSS))
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Received on Monday, 17 January 2000 06:34:08 UTC