[csswg-drafts] [css-text-3] line breaking rules around replaced-inline content incorrectly refer to ID class

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

== [css-text-3] line breaking rules around replaced-inline content incorrectly refer to ID class ==
Section 5.1 of css-text-3 says:

> The line breaking behavior of a replaced element or other atomic inline is equivalent to an ideographic character (Unicode linebreaking class ID [UAX14]), and additionally, for Web-compatibility, introduces a soft wrap opportunity between itself and any adjacent U+00A0 NO-BREAK SPACE character.

I'm not sure this is correct, for several reasons.

First, the next paragraph defines the behaviour of _word-break: keep-all_ as:

> Specifically it controls whether a soft wrap opportunity exists between adjacent typographic letter units (or other typographic character units belonging to the NU, AL, AI, or ID Unicode line breaking classes [UAX14]).

Which seems to imply that the soft-break opportunties are identical between "a国b" and "a[IMG]b", and that they can be prevented by setting "word-break: keep all".

Second, the line-breaking rules for ID class characters in UAX#14 do not match current browser behaviour even with word-break: normal. UAX#14 rule LB23a disallows a word-break between a numeric prefix (eg U+002C, plus sign) and an ideograph, but clearly the intention in CSS is not to disallow a soft wrap between a plus sign and a replaced inline.

The UAX#14 algorithm refers the object-replacement character, and explicitly states that this character is used to represent inline-objects in its algorithm. The behaviour of this approach seems to match current browser behaviour. So I think this bullet-point in 5.1 should be altered to:

> The line breaking behavior of a replaced element or other atomic inline is equivalent to an object-replacement character (U+FFFC, Unicode linebreaking class CB [UAX14]), and additionally, for Web-compatibility, introduces a soft wrap opportunity between itself and any adjacent U+00A0 NO-BREAK SPACE character. While UAX#14 allows the break behaviour of class CB characters to be further defined by the object itself, this is not done in CSS and inline object is treated as an "unresolved CB".

Or something along those lines. The phrase "unresolved CB" is from UAX#14.

Related: #2559, #567

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

Received on Thursday, 6 September 2018 16:00:59 UTC