Re: [CSS21] 16.3.1 text-decoration: inline box vs. inline element

I posted some questions on this property a while ago [1, 2] which 
never quite got answered i think. Boris and Jukka helped point out 
some of the issues with the old style underlining (sub/super), but i 
don't think anyone explained why the new way of defining the property 
is better (sub is probably more of an issue in the new model).

The main problem i see with the new way is that underlines are 
expected to overwrite images and form controls:

<p style="text-decoration: underline">
  Text <img src="dummy.png" style="vertical-align: top"/>
</p>
<p style="text-decoration: underline">
  Text-inputs are considered to have a baseline <input type="text" /> 
 in most implementations.
</p>
<p style="text-decoration: underline">
  Buttons as well <input type="button" value="DontPress"/> 
</p>

At least that's how i read: 
http://www.w3.org/TR/2004/CR-CSS21-20040225/text.html#lining-striking-
props
"Text decorations on inline boxes are drawn across the entire 
element, going across any descendant elements without paying any 
attention to their presence."

All vertically aligned texts will probably also work poorly in the 
new model:
<p style="text-decoration: underline">
  <small style="vertical-align: bottom">small text</small> <big>Big 
text</big>
</p>

You cannot stop this behavior using default styles. That is:
button {text-decoration: none}
will have no effect on the underline drawn across the button above.

As a side note i also think the CSS3-text properties 
'text-underline-mode', 'text-line-through-mode', 'text-overline-mode'
means any node in the tree may need to know where all the white-space 
characters of its descendants are in order to know where to draw its 
lines. 

Finally i find the number of MAYs in CSS3 (http://www.w3.org/TR/css3-
text/#text-decoration-introduction) regarding text-decoration and the 
"backwards-compatibility" disclaimer in CSS 2.1 slightly depressing.

 /Staffan

[1] http://lists.w3.org/Archives/Public/www-style/2003Oct/0000.html
[2] http://lists.w3.org/Archives/Public/www-style/2003Oct/0009.html

Received on Wednesday, 31 March 2004 12:07:58 UTC