Re: [css-text-decor] Doesn't example 3 in text-underline-position break current UA behavior?

Hello,

Using the “under” value in horizontal CJK text is not incorrect. In particular, many CJK glyphs (correctly) lie below the alphabetic baseline, which means that an underline which lies on the alphabetic baseline crashes into the glyphs. However, you are correct that using an “under” underline in common latin prose is unnatural.

Browsers shouldn't set one type of underline for an entire page based solely on the language of its root element or an ancestor element which happens to have a language attribute. You mentioned one case where this falls down: a CJK document which includes a latin blockquote. However, browsers should be free to solve this problem in the best way possible. In particular, the best underline position for one run of text may be different than for some other run, and those runs might be in the same HTML element. It's not possible to express default underline position logic that handles cases like this in the UA stylesheet.

It would be better to move the default underline position logic into text-underline-position: auto. This simplifies the UA stylesheet rules and allows the maximum freedom to improve default UA behavior in the future. However, the availability of a simple “under” value is still valuable for certain typographical situations which warrant it.

As for vertical text, the decision about whether to place the decoration on the left or the right is a decision best left to authors. In addition, that decision is orthogonal from the decision about the distance the underline lies from the text. However, authors should not be able to specify both “left” and “right” at once.

Because of all these concerns, we propose changing the syntax of text-underline-position to
[auto | under]? | [left | right]?
, making the default value of the property be auto, and removing the text-underline-position sections of the recommended default UA stylesheet.

Thanks,
Myles

> On May 11, 2015, at 1:50 AM, Masayuki Nakano <masayuki@d-toybox.com> wrote:
> 
> In EXAMPLE3 of text-underline-position <http://dev.w3.org/csswg/css-text-decor-3/#example-affafc32>, it suggests UA should use following style in its default UA style sheet:
> 
> :root:lang(ja), [lang|=ja],
> :root:lang(ko), [lang|=ko] {
>  text-underline-position: under right;
> }
> 
> :root:lang(zh), [lang|=zh] {
>  text-underline-position: under left;
> }
> 
> This means that UA should use "under" for horizontal writing mode too. And even if it has some Western language contents (e.g., in <blockquote>), the underlines in it are rendered as "under". I think that |:root| is not necessary.
> 
> And also current CJK web pages are rendered as |text-underline-position: auto;|. So, if UA style sheel had the suggested style, rendering result of CJK web pages would be changed. So, I think that the possible value of text-underline-position should be [auto|under] || [left|right].
> 
> If not so, if there were the UA which supports text-underline-position but doesn't support vertical writing mode, web pages which have |text-underline-position: left;| or |text-underline-position: right;| only for vertical writing contents would be rendered with the underlines positioned "under" even though the contents are rendered horizontally.
> 
> -- 
> Masayuki Nakano <masayuki@d-toybox.com>
> Manager, Internationalization, Mozilla Japan.
> 

Received on Wednesday, 17 June 2015 17:41:46 UTC