layout: Add support for white-space-collapse: break-spaces (#32388)

This change adds support for `white-space-collapse: break-spaces` and
adds initial parsing support for `overflow-wrap` and `word-break`. The
later two properties are not fully supported, only in their interaction
with `break-spaces`. This is a preliminary change preparing to implement
them.

In addition, `break_and_shape` is now forked and added to Layout 2020.
This function is going to change a lot soon and forking is preparation
for this. More code that is only used by Layout 2013 is moved from `gfx`
to that crate.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
This commit is contained in:
Martin Robinson 2024-05-30 07:33:07 +02:00 committed by GitHub
parent c0dedf06d6
commit 60b4b6c9f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
96 changed files with 410 additions and 537 deletions

View file

@ -1,3 +0,0 @@
[white-space-collapse-computed.html]
[Property white-space-collapse value 'break-spaces']
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-collapse-valid.html]
[e.style['white-space-collapse'\] = "break-spaces" should set the property value]
expected: FAIL

View file

@ -1,7 +1,3 @@
[white-space-computed.html]
[Property white-space value 'break-spaces' computes to 'break-spaces']
expected: FAIL
[Property white-space value 'break-spaces']
expected: FAIL

View file

@ -1,22 +1,4 @@
[white-space-shorthand.html]
[e.style['white-space'\] = "break-spaces" should set the property value]
expected: FAIL
[Property white-space value 'break-spaces']
expected: FAIL
[e.style['white-space'\] = "break-spaces wrap" should set the property value]
expected: FAIL
[Property white-space value 'break-spaces wrap']
expected: FAIL
[e.style['white-space'\] = "wrap break-spaces" should set the property value]
expected: FAIL
[Property white-space value 'wrap break-spaces']
expected: FAIL
[e.style['white-space'\] = "balance" should set the property value]
expected: FAIL

View file

@ -1,4 +0,0 @@
[white-space-valid.html]
[e.style['white-space'\] = "break-spaces" should set the property value]
expected: FAIL

View file

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

View file

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

View file

@ -1,2 +0,0 @@
[trailing-space-and-text-alignment-004.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[white-space-letter-spacing-001.html]
expected: FAIL

View file

@ -35,24 +35,6 @@
[Property text-wrap inherits]
expected: FAIL
[Property overflow-wrap has initial value normal]
expected: FAIL
[Property overflow-wrap inherits]
expected: FAIL
[Property word-break has initial value normal]
expected: FAIL
[Property word-break inherits]
expected: FAIL
[Property word-wrap has initial value normal]
expected: FAIL
[Property word-wrap inherits]
expected: FAIL
[Property text-wrap-style has initial value auto]
expected: FAIL

View file

@ -1,2 +0,0 @@
[overflow-wrap-anywhere-003.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[overflow-wrap-break-word-003.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[overflow-wrap-break-word-006.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[overflow-wrap-break-word-008.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[overflow-wrap-normal-keep-all-001.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[word-wrap-alias.html]
[word-wrap should be defined as an alias of overflow-wrap]
expected: FAIL

View file

@ -1,9 +0,0 @@
[overflow-wrap-computed.html]
[Property overflow-wrap value 'normal']
expected: FAIL
[Property overflow-wrap value 'break-word']
expected: FAIL
[Property overflow-wrap value 'anywhere']
expected: FAIL

View file

@ -1,9 +0,0 @@
[overflow-wrap-valid.html]
[e.style['overflow-wrap'\] = "normal" should set the property value]
expected: FAIL
[e.style['overflow-wrap'\] = "break-word" should set the property value]
expected: FAIL
[e.style['overflow-wrap'\] = "anywhere" should set the property value]
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-collapse-computed.html]
[Property white-space-collapse value 'break-spaces']
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-collapse-valid.html]
[e.style['white-space-collapse'\] = "break-spaces" should set the property value]
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-computed.html]
[Property white-space value 'break-spaces']
expected: FAIL

View file

@ -1,22 +1,4 @@
[white-space-shorthand.html]
[e.style['white-space'\] = "break-spaces" should set the property value]
expected: FAIL
[Property white-space value 'break-spaces']
expected: FAIL
[e.style['white-space'\] = "break-spaces wrap" should set the property value]
expected: FAIL
[Property white-space value 'break-spaces wrap']
expected: FAIL
[e.style['white-space'\] = "wrap break-spaces" should set the property value]
expected: FAIL
[Property white-space value 'wrap break-spaces']
expected: FAIL
[e.style['white-space'\] = "balance" should set the property value]
expected: FAIL

View file

@ -1,3 +0,0 @@
[white-space-valid.html]
[e.style['white-space'\] = "break-spaces" should set the property value]
expected: FAIL

View file

@ -1,13 +1,4 @@
[word-break-computed.html]
[Property word-break value 'normal']
expected: FAIL
[Property word-break value 'keep-all']
expected: FAIL
[Property word-break value 'break-all']
expected: FAIL
[Property word-break value 'break-word']
expected: FAIL

View file

@ -1,13 +1,4 @@
[word-break-valid.html]
[e.style['word-break'\] = "normal" should set the property value]
expected: FAIL
[e.style['word-break'\] = "keep-all" should set the property value]
expected: FAIL
[e.style['word-break'\] = "break-all" should set the property value]
expected: FAIL
[e.style['word-break'\] = "break-word" should set the property value]
expected: FAIL

View file

@ -1,9 +0,0 @@
[word-wrap-computed.html]
[Property word-wrap value 'normal']
expected: FAIL
[Property word-wrap value 'break-word']
expected: FAIL
[Property word-wrap value 'anywhere']
expected: FAIL

View file

@ -1,9 +0,0 @@
[word-wrap-valid.html]
[e.style['word-wrap'\] = "normal" should set the property value]
expected: FAIL
[e.style['word-wrap'\] = "break-word" should set the property value]
expected: FAIL
[e.style['word-wrap'\] = "anywhere" should set the property value]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-003.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-004.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-005.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-007.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-010.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-011.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-051.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-052.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-008.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-009.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-010.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-011.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-012.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-013.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-016.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-017.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-before-first-char-018.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-newline-011.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-newline-012.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-newline-013.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-newline-014.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-newline-015.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-newline-016.html]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[break-spaces-tab-004.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-003.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-004.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-005.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-006.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-007.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-008.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-009.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[break-spaces-with-overflow-wrap-010.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[hanging-whitespace-001.tentative.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[textarea-break-spaces-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[white-space-letter-spacing-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-002.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-003.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-005.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-006.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-007.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-008.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-009.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-010.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-011.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[ws-break-spaces-applies-to-014.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[word-break-keep-all-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[word-break-keep-all-002.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[word-break-keep-all-010.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[word-break-keep-all-006.htm]
expected: FAIL

View file

@ -1,2 +0,0 @@
[word-break-keep-all-007.htm]
expected: FAIL