-
Notifications
You must be signed in to change notification settings - Fork 645
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] Clarification about hanging spaces and max-content size #4359
Comments
In this case, the Conditionally hanging is at https://drafts.csswg.org/css-text-3/#conditionally-hang, two paragraphs after https://drafts.csswg.org/css-text-3/#hang (which is the one you quoted). It says:
So, in this case, the space is taken into account for max-content, the size of the div is 3 characters, and you see red. |
btw, this is a nice test case, thanks. I still need to update the tests in wpt to match the resolution of #3440 |
Wow, I didn't realize about the end line being a forced break. With that in mind, seeing red makes sense and it's correctly defined in the spec. Give me some time to think on other possible cases before closing the issue, but so far, everything looks sensible. |
Automatic update from web-platform-tests [css-text] Fix tests to match w3c/csswg-drafts#3440 -- [css-text] Add test based on w3c/csswg-drafts#4359 -- [css-text] Add tests based on spec examples -- wpt-commits: 65da2c8a6c6c4f93cae73034a2cbca9bde7413e0, 63d4c5cecaa8a5ae1f5b206e009f1c8e63c06eca, a6d00e0865b86f9440f0e079a7324a8eefa752ad wpt-pr: 19286
Automatic update from web-platform-tests [css-text] Fix tests to match w3c/csswg-drafts#3440 -- [css-text] Add test based on w3c/csswg-drafts#4359 -- [css-text] Add tests based on spec examples -- wpt-commits: 65da2c8a6c6c4f93cae73034a2cbca9bde7413e0, 63d4c5cecaa8a5ae1f5b206e009f1c8e63c06eca, a6d00e0865b86f9440f0e079a7324a8eefa752ad wpt-pr: 19286
Automatic update from web-platform-tests [css-text] Fix tests to match w3c/csswg-drafts#3440 -- [css-text] Add test based on w3c/csswg-drafts#4359 -- [css-text] Add tests based on spec examples -- wpt-commits: 65da2c8a6c6c4f93cae73034a2cbca9bde7413e0, 63d4c5cecaa8a5ae1f5b206e009f1c8e63c06eca, a6d00e0865b86f9440f0e079a7324a8eefa752ad wpt-pr: 19286 UltraBlame original commit: 847735988761b61a9301709d6588fbfab52f2358
Automatic update from web-platform-tests [css-text] Fix tests to match w3c/csswg-drafts#3440 -- [css-text] Add test based on w3c/csswg-drafts#4359 -- [css-text] Add tests based on spec examples -- wpt-commits: 65da2c8a6c6c4f93cae73034a2cbca9bde7413e0, 63d4c5cecaa8a5ae1f5b206e009f1c8e63c06eca, a6d00e0865b86f9440f0e079a7324a8eefa752ad wpt-pr: 19286 UltraBlame original commit: 847735988761b61a9301709d6588fbfab52f2358
Automatic update from web-platform-tests [css-text] Fix tests to match w3c/csswg-drafts#3440 -- [css-text] Add test based on w3c/csswg-drafts#4359 -- [css-text] Add tests based on spec examples -- wpt-commits: 65da2c8a6c6c4f93cae73034a2cbca9bde7413e0, 63d4c5cecaa8a5ae1f5b206e009f1c8e63c06eca, a6d00e0865b86f9440f0e079a7324a8eefa752ad wpt-pr: 19286 UltraBlame original commit: 847735988761b61a9301709d6588fbfab52f2358
Ok, everything is clear on my side. Thanks for the feedback. |
The CSS WG resolved recently (issue #3440) that preserved spaces by pre-wrap, if not followed by a forced break, must hang:
https://drafts.csswg.org/css-text-3/#white-space-phase-2
The above mentioned resolution included a clarification of the concept of hung vs conditionally hung glyph, which regarding this issue implies the following:
https://drafts.csswg.org/css-text-3/#hang
So, I wonder whether the following case is covered by the statements described before:
<div style="font: 20px/1 Ahem; color: green; background: red; width: max-content; white-space: pre-wrap">XX </div>
I'm not sure if the concept if "hanging glyph" implies that such glyph would otherwise overflow; at least I don't find that in the definition if hung descried in the link above. This is perhaps the first clarification I'd ask (if that's the case maybe we can add something in the spec about it)
Following what the White Space Processing Phase II states, the trailing space sequence must hang, hence it should not account for the box's max-content size. So, I'd expect no red color will be shown when rendering the example. However, both Firefox and Chrome renders the mentioned example as follows:
The text was updated successfully, but these errors were encountered: