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
Obey white-space when intrinsically sizing an IFC #31660
Obey white-space when intrinsically sizing an IFC #31660
Conversation
🔨 Triggering try run (#8278741244) for Linux WPT |
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#45102) with upstreamable changes. |
Test results for linux-wpt-layout-2013 from try job (#8278741244): Flaky unexpected result (19)
Stable unexpected results that are known to be intermittent (14)
|
Test results for linux-wpt-layout-2020 from try job (#8278741244): Flaky unexpected result (20)
Stable unexpected results that are known to be intermittent (15)
Stable unexpected results (21)
|
|
19a6e0a
to
e28bfe5
Compare
🔨 Triggering try run (#8280494677) for Linux WPT |
🤖 This change no longer contains upstreamable changes to WPT; closed existing upstream pull request (web-platform-tests/wpt#45102). |
Test results for linux-wpt-layout-2020 from try job (#8280494677): Flaky unexpected result (8)
Stable unexpected results that are known to be intermittent (20)
Stable unexpected results (6)
|
|
dbc39eb
to
4c69bf6
Compare
🔨 Triggering try run (#8283924617) for Linux WPT |
|
4c69bf6
to
161c30d
Compare
🔨 Triggering try run (#8284651355) for Linux WPT |
Test results for linux-wpt-layout-2020 from try job (#8284651355): Flaky unexpected result (12)
Stable unexpected results that are known to be intermittent (14)
Stable unexpected results (3)
|
161c30d
to
a8339e0
Compare
|
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.
Looks reasonable!
The old logic was assuming that all whitespace was a break opportunity, and that no newlines would be preserved. Note that text shaping considers the advance of a newline to be the same as a space. This was problematic because if we have a segment with a preserved space and newline, only the advance of the space should contrinute to the size of the block container. Therefore, I'm changing the breaker logic in other to have newline characters in their own segment. Then glyph_run_is_whitespace_ending_with_preserved_newline can just be renamed to glyph_run_is_preserved_newline. This patch is still not perfect because it doesn't check allow_wrap(), so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`.
a8339e0
to
c295e25
Compare
The old logic was assuming that all whitespace was a break opportunity,
and that no newlines would be preserved.
Note that text shaping considers the advance of a newline to be the same
as a space. This was problematic because if we have a segment with a
preserved space and newline, only the advance of the space should
contrinute to the size of the block container. Therefore, I'm changing
the breaker logic in other to have newline characters in their own
segment.
Then glyph_run_is_whitespace_ending_with_preserved_newline can just be
renamed to glyph_run_is_preserved_newline.
This patch is still not perfect because it doesn't check allow_wrap(),
so
nowrap
is treated likenormal
, andpre-wrap
likepre
../mach build -d
does not report any errors./mach test-tidy
does not report any errorswhite-space
#31652/css/css-text/tab-size/
fail because thetab-size
is not enabled on Servo./_mozilla/css/white-space-pre-wrap.htm
fails because of Whitespace withwhite-space: pre-wrap
at the end of the line should hang #31667