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

On 04/09/2011 11:57 AM, Koji Ishii wrote:
>
> 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.

"each line" is meant to refer to the line box, actually. The position and thickness
must be the same for a given text decoration application /per line box/. So the
position and thickness can be different if the element applying the text decoration
splits across multiple lines. If multiple elements use text-decoration within the
same line box, they can be different.

> 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?

End result of the interpretation is correct. :)

> 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.

Yes. But note that the "b" in the nested example is underlined *twice*,
once by the parent <span>, once by the child. For a solid underline, if
the position of the underline does not change, the inner underline paints
over the outer underline. But if the vertical-alignment of the span is
changed, for example, you can see that there are two underlines applied
to the "b".

> 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.

This is correct.

> 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.

Agreed.

~fantasai

Received on Sunday, 10 April 2011 01:26:40 UTC