LibWeb: Parse and propagate white-space-trim CSS property

This commit is contained in:
Callum Law 2025-05-18 02:21:42 +12:00 committed by Jelle Raaijmakers
parent 50bdd2cb85
commit 9480b1fc5c
Notes: github-actions[bot] 2025-05-29 10:06:01 +00:00
14 changed files with 151 additions and 7 deletions

View file

@ -233,10 +233,11 @@ All properties associated with getComputedStyle(document.body):
"230": "user-select",
"231": "vertical-align",
"232": "view-transition-name",
"233": "width",
"234": "x",
"235": "y",
"236": "z-index"
"233": "white-space-trim",
"234": "width",
"235": "x",
"236": "y",
"237": "z-index"
}
All properties associated with document.body.style by default:
{}

View file

@ -650,6 +650,8 @@ All supported properties and their default values exposed from CSSStylePropertie
'white-space': 'normal'
'whiteSpaceCollapse': 'collapse'
'white-space-collapse': 'collapse'
'whiteSpaceTrim': 'none'
'white-space-trim': 'none'
'width': '284px'
'wordBreak': 'normal'
'word-break': 'normal'

View file

@ -231,6 +231,7 @@ unicode-bidi: normal
user-select: auto
vertical-align: baseline
view-transition-name: none
white-space-trim: none
width: 784px
x: 0px
y: 0px

View file

@ -0,0 +1,3 @@
none
discard-inner
discard-after discard-inner

View file

@ -1,8 +1,8 @@
Harness status: OK
Found 199 tests
Found 200 tests
189 Pass
190 Pass
10 Fail
Pass accent-color
Pass border-collapse
@ -199,6 +199,7 @@ Pass unicode-bidi
Pass user-select
Pass vertical-align
Pass view-transition-name
Pass white-space-trim
Fail width
Pass x
Pass y

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<style>
#single-value {
white-space-trim: discard-inner;
}
#multiple-values {
white-space-trim: discard-inner discard-after;
}
</style>
<div id="default"></div>
<div id="single-value"></div>
<div id="multiple-values"></div>
<script src="../include.js"></script>
<script>
test(() => {
println(getComputedStyle(document.getElementById("default")).whiteSpaceTrim);
println(getComputedStyle(document.getElementById("single-value")).whiteSpaceTrim);
println(getComputedStyle(document.getElementById("multiple-values")).whiteSpaceTrim);
});
</script>