From 992b0a4dc6dbe228300ceeabe08d46ab1d5dea13 Mon Sep 17 00:00:00 2001 From: Callum Law Date: Thu, 20 Nov 2025 23:04:29 +1300 Subject: [PATCH] LibWeb: Parse the `scroll-timeline-axis` CSS property --- Libraries/LibWeb/CSS/Enums.json | 6 +++ Libraries/LibWeb/CSS/Keywords.json | 2 + .../LibWeb/CSS/Parser/PropertyParsing.cpp | 1 + Libraries/LibWeb/CSS/Properties.json | 10 +++++ ...eclaration-has-indexed-property-getter.txt | 1 + ...upported-properties-and-default-values.txt | 2 + .../css/getComputedStyle-print-all.txt | 1 + .../css/scroll-timeline-axis-computed.txt | 20 ++++++++++ .../css/scroll-timeline-axis-parsing.txt | 24 ++++++++++++ .../css/scroll-timeline-axis-computed.html | 37 +++++++++++++++++++ .../css/scroll-timeline-axis-parsing.html | 31 ++++++++++++++++ 11 files changed, 135 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.html diff --git a/Libraries/LibWeb/CSS/Enums.json b/Libraries/LibWeb/CSS/Enums.json index d4542c97cb1..0bdd578cdee 100644 --- a/Libraries/LibWeb/CSS/Enums.json +++ b/Libraries/LibWeb/CSS/Enums.json @@ -110,6 +110,12 @@ "textarea", "textfield" ], + "axis": [ + "block", + "inline", + "x", + "y" + ], "background-attachment": [ "fixed", "local", diff --git a/Libraries/LibWeb/CSS/Keywords.json b/Libraries/LibWeb/CSS/Keywords.json index 6bbe2eea4c5..2a301d937a3 100644 --- a/Libraries/LibWeb/CSS/Keywords.json +++ b/Libraries/LibWeb/CSS/Keywords.json @@ -628,6 +628,7 @@ "windowtext", "wrap", "wrap-reverse", + "x", "x-end", "x-large", "x-start", @@ -635,6 +636,7 @@ "xx-large", "xx-small", "xxx-large", + "y", "y-end", "y-start", "zoom-in", diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index 7dc4b4ad074..fef833b6b25 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -745,6 +745,7 @@ Parser::ParseErrorOr> Parser::parse_css_value(Pr return parse_all_as(tokens, [this](auto& tokens) { return parse_translate_value(tokens); }); case PropertyID::Scale: return parse_all_as(tokens, [this](auto& tokens) { return parse_scale_value(tokens); }); + case PropertyID::ScrollTimelineAxis: case PropertyID::ScrollTimelineName: return parse_all_as(tokens, [this, property_id](auto& tokens) { return parse_simple_comma_separated_value_list(property_id, tokens); }); case PropertyID::WhiteSpace: diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index 0069353466d..d9fa41d68ea 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -3440,6 +3440,16 @@ "affects-layout": false, "affects-stacking-context": true }, + "scroll-timeline-axis": { + "affects-layout": false, + "animation-type": "none", + "inherited": false, + "initial": "block", + "valid-types": [ + "axis" + ], + "multiplicity": "coordinating-list" + }, "scroll-timeline-name": { "affects-layout": false, "animation-type": "none", 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 214484d95fa..84f6d040557 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 @@ -259,6 +259,7 @@ All properties associated with getComputedStyle(document.body): "rx", "ry", "scale", + "scroll-timeline-axis", "scroll-timeline-name", "scrollbar-color", "scrollbar-gutter", 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 f357740ab65..cb6d8c95034 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 @@ -694,6 +694,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'rx': 'auto' 'ry': 'auto' 'scale': 'none' +'scrollTimelineAxis': 'block' +'scroll-timeline-axis': 'block' 'scrollTimelineName': 'none' 'scroll-timeline-name': 'none' 'scrollbarColor': 'auto' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 94b99b358f0..4e978653327 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -257,6 +257,7 @@ row-gap: normal rx: auto ry: auto scale: none +scroll-timeline-axis: block scroll-timeline-name: none scrollbar-color: auto scrollbar-gutter: auto diff --git a/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.txt new file mode 100644 index 00000000000..df32d636099 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.txt @@ -0,0 +1,20 @@ +Harness status: OK + +Found 14 tests + +13 Pass +1 Fail +Pass Property scroll-timeline-axis value 'initial' +Pass Property scroll-timeline-axis value 'inherit' +Pass Property scroll-timeline-axis value 'unset' +Pass Property scroll-timeline-axis value 'revert' +Pass Property scroll-timeline-axis value 'block' +Pass Property scroll-timeline-axis value 'inline' +Pass Property scroll-timeline-axis value 'y' +Pass Property scroll-timeline-axis value 'x' +Pass Property scroll-timeline-axis value 'block, inline' +Pass Property scroll-timeline-axis value 'inline, block' +Pass Property scroll-timeline-axis value 'block, y, x, inline' +Fail Property scroll-timeline-axis value 'inline, inline, inline, inline' +Pass The scroll-timeline-axis property shows up in CSSStyleDeclaration enumeration +Pass The scroll-timeline-axis property shows up in CSSStyleDeclaration.cssText \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.txt new file mode 100644 index 00000000000..488bafe9c05 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.txt @@ -0,0 +1,24 @@ +Harness status: OK + +Found 18 tests + +17 Pass +1 Fail +Pass e.style['scroll-timeline-axis'] = "initial" should set the property value +Pass e.style['scroll-timeline-axis'] = "inherit" should set the property value +Pass e.style['scroll-timeline-axis'] = "unset" should set the property value +Pass e.style['scroll-timeline-axis'] = "revert" should set the property value +Pass e.style['scroll-timeline-axis'] = "block" should set the property value +Pass e.style['scroll-timeline-axis'] = "inline" should set the property value +Pass e.style['scroll-timeline-axis'] = "y" should set the property value +Pass e.style['scroll-timeline-axis'] = "x" should set the property value +Pass e.style['scroll-timeline-axis'] = "block, inline" should set the property value +Pass e.style['scroll-timeline-axis'] = "inline, block" should set the property value +Pass e.style['scroll-timeline-axis'] = "block, y, x, inline" should set the property value +Fail e.style['scroll-timeline-axis'] = "inline, inline, inline, inline" should set the property value +Pass e.style['scroll-timeline-axis'] = "abc" should not set the property value +Pass e.style['scroll-timeline-axis'] = "10px" should not set the property value +Pass e.style['scroll-timeline-axis'] = "auto" should not set the property value +Pass e.style['scroll-timeline-axis'] = "none" should not set the property value +Pass e.style['scroll-timeline-axis'] = "block inline" should not set the property value +Pass e.style['scroll-timeline-axis'] = "block / inline" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.html b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.html new file mode 100644 index 00000000000..6dac8c28daa --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-computed.html @@ -0,0 +1,37 @@ + + + + + + +
+
+
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.html b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.html new file mode 100644 index 00000000000..36946c82c32 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-axis-parsing.html @@ -0,0 +1,31 @@ + + + + + +
+ +