-
Notifications
You must be signed in to change notification settings - Fork 715
[css-text-3] line breaks and ideographic space #2500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CSS Text Level 3 does not normatively define the line breaking behavior of every character. Nor does it normatively reference UAX14's tables, because while they are a good start, they do not represent the ideal breaking behavior of every language. We could add specific rules for ideographic space. Allowing it to hang seems reasonable: if @MurakamiShinyu agrees we should specify that I'm happy to do it. Note that if it hangs, it effectively is BA because it's effectively zero-width when occurring at the end of the line. ;) |
Yes, I agree the behavior allowing hanging is preferable. |
I wonder what we should do about runs of IDEOGRAPHIC SPACEs should the whole thing hang? Only the last one? Hopefully we can just treat that as an edge case that's not really how people should write web pages, and spec whatever is simplest. |
@MurakamiShinyu Do you have a suggestion about whether to hang multiple ideographic spaces? Or maybe we should hang one and wrap the rest? |
…y handle typical CJK typesetting. #2500
f55dc74 hangs the whole sequence of ideographic spaces at the end of the line, let us know if that's fine. |
Tests: web-platform-tests/wpt#13338 |
I know, not web, but InDesign allows the treatment of U+3000 to wrap like other non-space characters, depending on the paragraph composer chosen: Roman composer treats U+3000 like ideographic characters (they wrap); Japanese composer treats as white space (allowing them to hang). I think there are use cases where strings of U+3000 would be expected to wrap the line, so having a selector may be desirable. For me, I like that there is also the U+2003 for when you want the space to hang, so I prefer treating U+3000 as wrapping and U+2003 as hanging. |
@macnmm I don't think we define U+2003 as hanging. Should we, for reasons other than CJK? currently, we only hang U+0020 and U+3000. Should that be generalized to all sorts of spaces? Many-but-not-all sorts of spaces? As for having a switch, we effectively have one:
Whether that's acceptable or not, I am not sure, it depends on the use case. Which brings me to: what is the need that drives wrapping U+3000 in the InDesign roman paragraph composer? Is that because of a particular need, or does it just falls out of not handling CJK characters specially, but isn't particularly need driven? |
The need was an edge case when converting old file formats in which the user used U+3000 to indent or place text on embox boundaries on the page, expecting them to wrap like other CJK characters would. |
That use case doesn't really seem to apply to the web. |
…ace, a=testonly Automatic update from web-platform-tests[css-text] Trailing ideographic white-space (#13338) Relates to w3c/csswg-drafts#2500 -- wpt-commits: 85746ce0c5b8e8403c0238af6469d7177ed15c49 wpt-pr: 13338
…ace, a=testonly Automatic update from web-platform-tests[css-text] Trailing ideographic white-space (#13338) Relates to w3c/csswg-drafts#2500 -- wpt-commits: 85746ce0c5b8e8403c0238af6469d7177ed15c49 wpt-pr: 13338
…ace, a=testonly Automatic update from web-platform-tests[css-text] Trailing ideographic white-space (#13338) Relates to w3c/csswg-drafts#2500 -- wpt-commits: 85746ce0c5b8e8403c0238af6469d7177ed15c49 wpt-pr: 13338 UltraBlame original commit: 62d9a252e6b979903db49bad58c8dfae98032012
…ace, a=testonly Automatic update from web-platform-tests[css-text] Trailing ideographic white-space (#13338) Relates to w3c/csswg-drafts#2500 -- wpt-commits: 85746ce0c5b8e8403c0238af6469d7177ed15c49 wpt-pr: 13338 UltraBlame original commit: 62d9a252e6b979903db49bad58c8dfae98032012
…ace, a=testonly Automatic update from web-platform-tests[css-text] Trailing ideographic white-space (#13338) Relates to w3c/csswg-drafts#2500 -- wpt-commits: 85746ce0c5b8e8403c0238af6469d7177ed15c49 wpt-pr: 13338 UltraBlame original commit: 62d9a252e6b979903db49bad58c8dfae98032012
The definition of the various values of the white-space property in section 3 does not go into much detail about exactly how they work, and just provides a high level intro to what they do. The details are provided in section 4, and in particular 4.1 and 4.3 (so called “phase 1” and “phase 2” of white space processing). While this phase 2 has been updated (see w3c#2500 w3c#3879 w3c#4180) to define that not only space characters, but also other space separators hang / don't hang / wrap / don't wrap, etc, based on the value of the white-space property, the high level definition of these values was not updated to reflect that. While this is not necessarily a bug, as it is already called out that details are in section 4, apparent contradictions or omissions can be confusing. Therefore, in the part of these definitions that explicitly talked about white space wrapping/hanging (or not), include other space separators as well, as defined in 4.3.
(reference: https://bugzilla.mozilla.org/show_bug.cgi?id=1450228)
Browsers differ in how they handle line breaks for IDEOGRAPHIC SPACE (U+3000):
try it here
Quoting @MurakamiShinyu
That logic would favor Edge's behavior.
UAX-14 says that IDEOGRAPHIC SPACE (U+3000) has class BA (for break after), which would support the behavior of Chrome/Safari/Edge over Firefox's, but:
Should we reference the BA class somehow?
Should we directly list DEOGRAPHIC SPACE (U+3000) in some level of line-break?
Should we say something about allowing/requiring it to hang?
The text was updated successfully, but these errors were encountered: