Content-Length: 266050 | pFad | https://github.com/w3c/csswg-drafts/issues/5783#issuecomment-745006620

64 [css-text] Inconsistency on how 'break-spaces' value handles the first space of an overflowing sequence · Issue #5783 · w3c/csswg-drafts · GitHub
Skip to content
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] Inconsistency on how 'break-spaces' value handles the first space of an overflowing sequence #5783

Closed
javifernandez opened this issue Dec 11, 2020 · 4 comments
Assignees
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-text-3 Current Work editorial Tested Memory aid - issue has WPT tests

Comments

@javifernandez
Copy link
Contributor

I think the following statement of the White Space Processing Phase II is incorrect, or at least, inconsistent with other statements about how we should handle the first space of an overflowing sequence when the white-space property is set to 'break-spaces':

https://drafts.csswg.org/css-text-3/#white-space-phase-2

If white-space is set to break-spaces, hanging or collapsing the advance width of the spaces, tabs, or other space separators at the end of the line is not allowed; those that overflow must wrap to the next line.

I think the last sentence "those that overflow must wrap ..." is not correct and should clearly state "those after the first space that overflow ..." instead (or something like this).

The current statement is inconsistent with what Phase I describes:

https://drafts.csswg.org/css-text-3/#white-space-phase-2

... However, for pre-wrap, a soft wrap opportunity exists at the end of a sequence of spaces and/or tabs, while for break-spaces, a soft wrap opportunity exists after every space and every tab.

It's even clearer in the specific prose of the 'break-spaces' value:

https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces

A line breaking opportunity exists after every preserved white space character and after every other space separator (including between adjacent spaces).

@frivoal
Copy link
Collaborator

frivoal commented Dec 14, 2020

Ah, interesting. I think we agree on the behavior, the question is to make sure it is correctly phrased. those after the first one should absolutely wrap, but for the first one, what that sentence tries to say is that since they're not hanging or collapsing, they should be wrapped to the next line together with whatever is before them, going back as far as needed to find a wrapping opportunity.

So if you have a b  and room for three characters, the resulting layout should be

|a  |
|b  |

as the overflowing space and the b before it get wrapped.

But I can see how the existing phrasing can be read to suggest something else. I suspect that the easiest way to make the sentence unambiguously correct is to just delete ; those that overflow must wrap to the next line, as that's just meant to be a clarification anyway.

Combined with for break-spaces, a soft wrap opportunity exists after every space and every tab. from earlier in the same section, that's enough to get the normative behavior we want.

I think it would be nice to find an alternative wording instead of just deleting it, and I think the one you suggested is differently misleading, but I'm not too sure about a better one.

@javifernandez
Copy link
Contributor Author

javifernandez commented Dec 14, 2020

If we can't find a better working, I think it's better to remove the text as you suggested. However, I still see a bit confusing that the spec states so categorically that "hanging is not allowed" when there are cases where it is.

@fantasai
Copy link
Collaborator

OK, made some edits. @javifernandez Let us know if that works for you!

@javifernandez
Copy link
Contributor Author

The change looks good. Thanks !

@javifernandez javifernandez added Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. and removed Commenter Response Pending labels Dec 15, 2020
@frivoal frivoal added the Tested Memory aid - issue has WPT tests label Dec 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closed Accepted as Editorial Commenter Satisfied Commenter has indicated satisfaction with the resolution / edits. css-text-3 Current Work editorial Tested Memory aid - issue has WPT tests
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/w3c/csswg-drafts/issues/5783#issuecomment-745006620

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy