Re: [csswg-drafts] [css-text-3] Discarding Line Breaks Adjacent to Ambiguous Characters (#5017)

@r12a:
> Which aspect of ambiguity are we talking about here?
> a. a space may be added where not wanted, eg. 支持W3C实现“\尽展
> b. a space may be removed when it should stay, eg. 空格字符“ \”不可见

This issue is about trying to address a) without introducing problems with b).

@kidayasuo: 
Soft wrapping lines of text for presentation handles breaks at emdash and hyphens OK, because there isn't actually any space introduced, so rewrapping at a different point doesn't have a problem. When wrapping source code, though, we are introducing characters at the break. The historical rules here are not very sophisticated: if there is a break in the source, it is turned into a space. This is OK for space-separated languages: it is easy to find a place to break at a space nearby, and we know to only break at spaces in our source code even if it is sometimes a little off from the ideal breakpoint if we were wrapping text for presentation.

CSS3 is trying to make this a bit more sophisticated, so that Chinese and Japanese can benefit from being able to break within paragraphs in their source code also. Since these languages don't use spaces at all, under the historical rules they cannot break at all, otherwise it introduces a space.

Because historically breaks became spaces, the new rules are biased to be "conservative" in that they will apply the historical behavior of turning the break into a space when it's not clear whether to discard or not. The currently proposed rule (which is similar to what Firefox currently implements) thus says, if both sides of the break are CJ, discard. If either side is not, use a space.

This issue is about fine-tuning those new rules, specifically about whether to introduce a concept of an "ambiguous" character, which defers to the opposite side whether CJ or not (and which defaults to space if the other side is also ambiguous). The primary use case for would be Symbols.

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5017#issuecomment-633726313 using your GitHub account

Received on Monday, 25 May 2020 21:55:07 UTC