Re: [css3-text] Underlines match the color of the text (was Allow control of text-decoration width

On Thu, Apr 7, 2011 at 3:21 PM, Koji Ishii <kojiishi@gluesoft.co.jp> wrote:
> I didn't check color behavior of Word, but it's interesting too. Current CSS3 Text spec[1] says:
>
>> 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.
>
> The definition is different from Word. It looks like Word does:
> * If underline color is auto, underlines match the color of the character it is drawn for. The color of underline is changed even within single underline.
> * If underline style is changed, Word considers underlines were split at the point style was changed.
>
> It looks like CSS does better job for style changes. Is this correct?
>
> For color, I'm not sure which is the right behavior. Do you have any clues, references, or anything else we can determine the right behavior?

Underlining is relatively rare and color changes are relatively rare,
so this doesn't come up too much.  But it came up for me in the real
world just last week.  The case was that anolis (a preprocessor for
specifications written in HTML, used by HTML5 and a couple of specs I
edit) generates auto-links for cross-references.  Cross-references can
be <code> elements, so it was generating code like

  <a href=...><code>...</code></a>

The stylesheet had <code> bold orange.  So this produced a blue
underline under orange text, which wasn't the desired effect at all.
I've run into this once or twice before, and have trouble seeing where
it would ever be the desired behavior.

On Fri, Apr 8, 2011 at 1:29 AM, Koji Ishii <kojiishi@gluesoft.co.jp> wrote:
> I understand there's a compatibility issue. But if matching underline colors to the color of text is oftentimes desired behavior, we could add another value to avoid compatibility issues like this:
>
>  text-decoration-color: textColor
>
> I'm not sure if it's important enough to justify the cost, but both Word and In Design behaving so makes me believe it is more common than CSS 2.1 way.
>
> Is this wrong, or not too important given its cost?

I imagine it would be low-priority, given that this is a pretty rare
issue and you can work around it.  Tab Atkins says he's never run into
it himself, and I've only run into it a couple of times, so it's
probably not worth discussing further.  I'll just leave a note in my
spec about the possible correctness issues that can arise in corner
cases -- it's not a big deal.  (I'd still like the spec to require
underline thickness/placement like IE, because that just looks better,
but that's a separate thread.)

Received on Friday, 8 April 2011 20:54:11 UTC