-
Notifications
You must be signed in to change notification settings - Fork 657
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
[css-text-3] break spaces #111
Changes from 2 commits
8ddda77
8a74b58
1e017c1
d522b46
851871f
807a5eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -755,6 +755,9 @@ Languages and Typesetting</h4> | |
the UA must either <a>hang</a> the <a>white space</a> | ||
or visually collapse their character advance widths | ||
such that they don't take up space in the line. | ||
However, if 'overflow-wrap' is set to ''break-spaces'', | ||
collapsing their advance width is not allowed, | ||
as this would prevent the preserved spaces from wrapping. | ||
|
||
Note: Hanging the white space rather than collapsing it | ||
allows users to see the space when selecting or editing text. | ||
|
@@ -1296,7 +1299,7 @@ Line Breaking Details</h3> | |
|
||
<pre class='propdef'> | ||
Name: overflow-wrap, word-wrap | ||
Value: normal | break-word | ||
Value: normal | break-word | break-spaces | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought this was for L4, but I admit that I wasn't paying much attention to which level we resolved on. Have a link to the resolution? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the resolution (SF or Syndey) specified if it was level 3 or 4. My main reason for preferring having it in L3 is:
Also from a spec editing point of view, L3 is easier (but I agree this is not an important reason):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Totally understandable, and I don't have preference either way, but when I want to follow the resolution, you and I having different understanding looks like a sign that it's better to double-check with WG, no? In my understanding, fantasai said L4 at the beginning of the discussion and that was applied to all the discussion, but now it's unclear to me too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. I've pinged the WG now, let's see what comes out of this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. RESOLVED: Add overflow-wrap: break-spaces to level 3 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kojiishi ping. Do you want me to adjust something in the pull request before you can merge it, or is it fine like this? |
||
Initial: normal | ||
Applies to: all elements | ||
Inherited: yes | ||
|
@@ -1324,6 +1327,11 @@ Canonical order: N/A | |
Shaping characters are still shaped as if the word were not | ||
broken, and grapheme clusters must stay together as one unit. | ||
No hyphenation character is inserted at the break point. | ||
<dt><dfn>break-spaces</dfn></dt> | ||
<dd>Line breaks are handled identically to ''overflow-wrap/normal'', | ||
except that any sequence of <a>preserved</a> white space | ||
that would otherwise overflow the line under these rules | ||
must be broken after the last white space character that would fit the line. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So when you say
you want to break between preserved white spaces but not before/after? Can you try to clarify? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this be clearer?
This is meant to be the same behavior, but should be more explicit. Break in places unrelated to the white space sequence are allowed as usual; it allows the break to happen after the last character in the sequence. It does not create a break opportunity between the first white space character in the sequence and whatever comes before it, to avoid wrapping a single space to the next line (I think you were the first to suggest that that would be a bad idea). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a member, I still don't understand why one would want this, but as an editor, I can review PRs according to resolutions. That makes me a good reviewer though. Since I don't understand how it's used, I can review how the text reads to implementors without any background ;-) What will happen if there are no spaces that can fit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the delayed answer. If there is no spaces that would fit, you deal with it the way you would otherwise: break the line somewhere earlier if you can, or overflow if you cannot. I don't actually have a strong opinion whether we should allow a break before the first space in a sequence of not, but I believe you were the one who expressed a preference for disallowing it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make a call, as I said, I don't understand how it's used. So from what I understand, when all of the following condition met:
You want to break between spaces, but not before/after? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very sorry for the slow answer.
correct, if
Not before the first space if I think this is the best behavior, but I am not very strongly attached to this nuance, so if the rest of the proposal is OK and this is blocking, I am open to changing this part.
I don't think there's anything in the wording I proposed that prohibits breaking after spaces. If the end of the line falls earlier than the last space, you should break at that earlier point, but if it falls right after that space, breaking there is the normal thing to do. 2 questions:
|
||
</dl> | ||
|
||
<p><a>Soft wrap opportunities</a> introduced by ''overflow-wrap: break-word'' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When ''break-spaces'', spaces breaks, so it no longer be "at the end of a line". I think I understand your intention but it can confuse rather than help. Maybe you could add such note that this will not happen if ''break-spaces'' if you think having text here is important?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When 'break-spaces' is specified, spaces should break. But this would not happen if they have already been collapsed, so I am trying to (normatively) make it explicit that you cannot do that. I thought this text was easier to understand here than in the definition of the break-spaces value. Do you think it should be moved? Do you have a suggestion of a better way to phrase it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By re-reading this, you're modifying an item that I don't understand, so it's not your problem, but you'd have to ask fantasai to review.
This item starts with:
but I can't interpret this part. Does this "but" mean "except"? Maybe clear to native speakers but this is beyond my English capability, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this "but" could just as easily be replaced with "and". We're talking about a subset of of the non-collapsible spaces. "If there are non-collapsible spaces and when 'white-space' is set to ''pre-wrap''" is the same as "if there are non-collapsible spaces, but [only in the case when] 'white-space' set to ''pre-wrap''"