Skip to content

Truly independent web browser

LibWeb: Parse and compute hyphenate-character

Andreas Kling415d96f55247
diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json
index 5b9f483ba44..65e8a6262d1 100644
--- a/Libraries/LibWeb/CSS/Properties.json
+++ b/Libraries/LibWeb/CSS/Properties.json
@@ -3004,6 +3004,19 @@
],
"needs-layout-for-getcomputedstyle": true
},
+ "hyphenate-character": {
+ "__comment": "FIXME: Use this string when hyphenation is implemented.",
+ "animation-type": "discrete",
+ "inherited": true,
+ "initial": "auto",
+ "requires-computation": "never",
+ "valid-types": [
+ "string"
+ ],
+ "valid-identifiers": [
+ "auto"
+ ]
+ },
"image-rendering": {
"style-group": "InheritedBoxValues",
"animation-type": "discrete",
diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt
index b64752c5a33..63494aa5ecb 100644
--- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt
+++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt
@@ -43,6 +43,7 @@ All properties associated with getComputedStyle(document.body):
"font-weight",
"font-width",
"forced-color-adjust",
+ "hyphenate-character",
"image-rendering",
"interpolate-size",
"letter-spacing",
diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
index cc67634e554..43d59c6aa6d 100644
--- a/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
+++ b/Tests/LibWeb/Text/expected/css/CSSStyleProperties-all-supported-properties-and-default-values.txt
@@ -620,6 +620,8 @@ All supported properties and their default values exposed from CSSStylePropertie
'gridTemplateRows': 'none'
'grid-template-rows': 'none'
'height': '134px'
+'hyphenateCharacter': 'auto'
+'hyphenate-character': 'auto'
'imageRendering': 'auto'
'image-rendering': 'auto'
'inlineSize': '284px'
diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt
index d7fa1ea6e38..ed1445b486d 100644
--- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt
+++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt
@@ -41,6 +41,7 @@ font-variation-settings: normal
font-weight: 400
font-width: 100%
forced-color-adjust: auto
+hyphenate-character: auto
image-rendering: auto
interpolate-size: numeric-only
letter-spacing: normal
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt
index eae6917cde2..46d10d71b6b 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-cascade/all-prop-revert-layer.txt
@@ -1,8 +1,8 @@
Harness status: OK
-Found 343 tests
+Found 344 tests
-339 Pass
+340 Pass
4 Fail
Pass accent-color
Pass border-collapse
@@ -40,6 +40,7 @@ Pass font-variation-settings
Pass font-weight
Pass font-width
Pass forced-color-adjust
+Pass hyphenate-character
Pass image-rendering
Pass letter-spacing
Pass line-height
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/animations/hyphen-no-interpolation.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/animations/hyphen-no-interpolation.txt
index 85c6824505b..4e64398ca1d 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/animations/hyphen-no-interpolation.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/animations/hyphen-no-interpolation.txt
@@ -2,49 +2,50 @@ Harness status: OK
Found 168 tests
-168 Fail
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
-Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
-Fail CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
-Fail CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
-Fail CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
-Fail CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
-Fail Web Animations: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
+42 Pass
+126 Fail
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
+Pass CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
+Pass CSS Transitions with transition-property:all and transition-behavor:allow-discrete: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
+Pass CSS Transitions: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
+Pass CSS Transitions with transition: all: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
+Pass CSS Animations: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (-0.3) should be [initial]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0) should be [initial]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0.3) should be [initial]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0.5) should be ["e"]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (0.6) should be ["e"]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (1) should be ["e"]
+Pass Web Animations: property <hyphenate-character> from [initial] to ["e"] at (1.5) should be ["e"]
Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-limit-chars> from [initial] to [10] at (-0.3) should be [initial]
Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-limit-chars> from [initial] to [10] at (0) should be [initial]
Fail CSS Transitions with transition-behavior:allow-discrete: property <hyphenate-limit-chars> from [initial] to [10] at (0.3) should be [initial]
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-computed.txt
index 43ed484477d..b01aa1722f9 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-computed.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-computed.txt
@@ -2,9 +2,9 @@ Harness status: OK
Found 5 tests
-5 Fail
-Fail Property hyphenate-character value 'auto'
-Fail Property hyphenate-character value '"="'
-Fail Property hyphenate-character value '"/-/"'
-Fail Property hyphenate-character value '"\1400"'
-Fail Property hyphenate-character value '""'
\ No newline at end of file
+5 Pass
+Pass Property hyphenate-character value 'auto'
+Pass Property hyphenate-character value '"="'
+Pass Property hyphenate-character value '"/-/"'
+Pass Property hyphenate-character value '"\1400"'
+Pass Property hyphenate-character value '""'
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-valid.txt
index bd2978f1d2f..b7a0bed1228 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-valid.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-text/parsing/hyphenate-character-valid.txt
@@ -2,9 +2,9 @@ Harness status: OK
Found 5 tests
-5 Fail
-Fail e.style['hyphenate-character'] = "auto" should set the property value
-Fail e.style['hyphenate-character'] = "\"=\"" should set the property value
-Fail e.style['hyphenate-character'] = "\"/-/\"" should set the property value
-Fail e.style['hyphenate-character'] = "\"\\1400\"" should set the property value
-Fail e.style['hyphenate-character'] = "\"\"" should set the property value
\ No newline at end of file
+5 Pass
+Pass e.style['hyphenate-character'] = "auto" should set the property value
+Pass e.style['hyphenate-character'] = "\"=\"" should set the property value
+Pass e.style['hyphenate-character'] = "\"/-/\"" should set the property value
+Pass e.style['hyphenate-character'] = "\"\\1400\"" should set the property value
+Pass e.style['hyphenate-character'] = "\"\"" should set the property value
\ No newline at end of file