[csswg-drafts] [css-text-decor] Clarifying skip-ink:auto behavior in relation to CJK text (#4276)

jfkthame has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-text-decor] Clarifying skip-ink:auto behavior in relation to CJK text ==
See Issue 8 in [CSS Text Decoration Module Level 4](https://drafts.csswg.org/css-text-decor-4/#issue-01cb5447),

Currently, it appears that Webkit and Blink browsers forcibly disable ink-skipping behavior (as if `text-decoration-skip-ink:none` were in effect) for a hardcoded list of “CJK” characters.

However, they disagree on the exact set of characters for which skipping is disabled. In particular, Blink seems to add a large but (apparently) rather ad hoc [collection of punctuation and other symbols](https://chromium.googlesource.com/chromium/src/+/refs/heads/master/third_party/blink/renderer/platform/text/character_property_data.h#12) that are not especially associated with CJK text. Hence, these characters don’t get ink-skipping behavior in Chrome even though they may equally well be used in the context of Latin or other scripts, not just in CJK contexts. On the other hand, in Webkit they do get skipped, whether used in Latin or CJK contexts. (Compare testcase: https://jsfiddle.net/rhLjauq4/ in Chrome vs Safari.)

In Gecko’s implementation (not yet enabled in release builds, but available for testing in Firefox nightlies), we’ve taken a slightly different approach. Rather than a fixed set of *characters* for which ink-skipping is disabled, which is problematic precisely because of the large number of “common” characters — mainly punctuation and symbols — that are used in both CJK and non-CJK contexts, the decision whether to disable skip-ink is taken on a per-script-run basis. CJK ideographs are of course recognised as belonging to a CJK script, but in addition, “common” characters will be merged into the same script run when used in a CJK context, and so the same non-skipping behavior will be applied to them *in CJK context only*.

I think it would be helpful for authors if there were agreement as to which characters are or aren’t eligible for skip-ink behavior when `auto` is in effect. Given the substantial number of ambiguous “common” characters, a simple partitioning of individual characters (as currently implemented in Webkit and Blink, AFAICT) is not a particularly good solution. I expect layout engines already do some kind of script-run analysis in order to handle font selection and shaping appropriately, and therefore using script runs as the basis for deciding when to disable ink skipping should not be overly burdensome, and I believe results in more useful behavior. Would the WG and other browser developers be prepared to converge on this approach, and include it in the text-decoration spec?


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4276 using your GitHub account

Received on Wednesday, 4 September 2019 10:33:58 UTC