Obey white-space when intrinsically sizing an IFC (#31660)

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`.
This commit is contained in:
Oriol Brufau 2024-03-15 13:45:23 +01:00 committed by GitHub
parent 74b5f798cd
commit 99c14c83ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 71 additions and 72 deletions

View file

@ -0,0 +1,2 @@
[tab-size-integer-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[tab-size-integer-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[tab-size-integer-003.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[tab-size-length-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[tab-size-length-002.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[tab-size-percent-001.html]
expected: FAIL