RE: [css3-text] Adjacent and nested underlines (was Allow control of text-decoration width

Before discussing further, I'd like us to share the understanding of what the spec[1] says today:
]]
In determining the position and thickness of text decoration lines, user agents may consider the font sizes and dominant baselines of descendants, but for a given element's decoration must use the same baseline and thickness throughout each line.
[[

Here's a simplified version of Aryeh's example:

.u { text-decoration: underline; }
.r { color: Red; font-size:400%; }

<p>Nested: <span class="u">a<span class="u r">b</span>c</span></p>
<p>Adjacent: <span class="u">d</span><span class="u r">e</span></p>

The position and thickness must be the same throughout "each line", so the question is what the "line" is. I think the spec doesn't state this clearly, but I assume, a line starts by text-decoration-line: underline, overline, or line-through and ends at the end of the given element. If an element is already part of a line, it will not start a new line.

If this is correct interpretation, the nested version has single line, and the adjacent version has two lines. Can someone confirm this, or correct me if my interpretation differs from yours?

Next about the color and style:
]]
The color and line style of decorations must remain the same on all decorations applied by a given element, even if descendant elements have different color or line style values.
[[

This time, the spec says "by a given element", not "each line". I understand this as color and style changes for "b" in the nested example. It also changes for "e" in the adjacent example as lines are split.

If all these interpretations are correct, I assume the expected results are:
* The position and thickness are the same for "abc".
* The position and thickness for "d" and "e" could be different.
* Underlines for "b" and "e" are in red.

I'd appreciate if someone can confirm/correct this. If correct, it might be good to add the clarification of "what the line is" to the spec.


Regards,
Koji

[1] http://dev.w3.org/csswg/css3-text/#line-decoration

Received on Saturday, 9 April 2011 18:59:18 UTC