From e95f326f3d69c7af731175f6e33b9cdff42e27d9 Mon Sep 17 00:00:00 2001 From: Callum Law Date: Thu, 20 Nov 2025 22:43:11 +1300 Subject: [PATCH] LibWeb: Parse the `scroll-timeline-name` CSS property --- .../LibWeb/CSS/Parser/PropertyParsing.cpp | 2 + Libraries/LibWeb/CSS/Properties.json | 13 +++++++ ...eclaration-has-indexed-property-getter.txt | 1 + ...upported-properties-and-default-values.txt | 2 + .../css/getComputedStyle-print-all.txt | 1 + .../css/scroll-timeline-name-computed.txt | 19 ++++++++++ .../css/scroll-timeline-name-parsing.txt | 26 +++++++++++++ .../css/scroll-timeline-name-computed.html | 37 +++++++++++++++++++ .../css/scroll-timeline-name-parsing.html | 32 ++++++++++++++++ 9 files changed, 133 insertions(+) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-computed.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-computed.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.html diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index 916d7117c5f..7dc4b4ad074 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -745,6 +745,8 @@ 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::ScrollTimelineName: + return parse_all_as(tokens, [this, property_id](auto& tokens) { return parse_simple_comma_separated_value_list(property_id, tokens); }); case PropertyID::WhiteSpace: return parse_all_as(tokens, [this](auto& tokens) { return parse_white_space_shorthand(tokens); }); case PropertyID::WhiteSpaceTrim: diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index 44003355cd8..0069353466d 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -3440,6 +3440,19 @@ "affects-layout": false, "affects-stacking-context": true }, + "scroll-timeline-name": { + "affects-layout": false, + "animation-type": "none", + "inherited": false, + "initial": "none", + "valid-identifiers": [ + "none" + ], + "valid-types": [ + "dashed-ident" + ], + "multiplicity": "coordinating-list" + }, "scrollbar-color": { "affects-layout": false, "animation-type": "by-computed-value", 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 f470aeac645..214484d95fa 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-name", "scrollbar-color", "scrollbar-gutter", "scrollbar-width", 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 b9204b30f46..f357740ab65 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' +'scrollTimelineName': 'none' +'scroll-timeline-name': 'none' 'scrollbarColor': 'auto' 'scrollbar-color': 'auto' 'scrollbarGutter': 'auto' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 1f92d3e8e80..94b99b358f0 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-name: none scrollbar-color: auto scrollbar-gutter: auto scrollbar-width: auto diff --git a/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-computed.txt b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-computed.txt new file mode 100644 index 00000000000..70635a966df --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-computed.txt @@ -0,0 +1,19 @@ +Harness status: OK + +Found 13 tests + +12 Pass +1 Fail +Pass Property scroll-timeline-name value 'initial' +Pass Property scroll-timeline-name value 'inherit' +Pass Property scroll-timeline-name value 'unset' +Pass Property scroll-timeline-name value 'revert' +Pass Property scroll-timeline-name value 'none' +Pass Property scroll-timeline-name value '--foo' +Pass Property scroll-timeline-name value '--foo, --bar' +Pass Property scroll-timeline-name value '--bar, --foo' +Pass Property scroll-timeline-name value '--a, --b, --c, --D, --e' +Fail Property scroll-timeline-name value 'none, none' +Pass Property scroll-timeline-name value '--a, --b, --c, none, --d, --e' +Pass The scroll-timeline-name property shows up in CSSStyleDeclaration enumeration +Pass The scroll-timeline-name 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-name-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.txt new file mode 100644 index 00000000000..97dcdf8c6d8 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.txt @@ -0,0 +1,26 @@ +Harness status: OK + +Found 20 tests + +19 Pass +1 Fail +Pass e.style['scroll-timeline-name'] = "initial" should set the property value +Pass e.style['scroll-timeline-name'] = "inherit" should set the property value +Pass e.style['scroll-timeline-name'] = "unset" should set the property value +Pass e.style['scroll-timeline-name'] = "revert" should set the property value +Pass e.style['scroll-timeline-name'] = "none" should set the property value +Pass e.style['scroll-timeline-name'] = "--abc" should set the property value +Pass e.style['scroll-timeline-name'] = " --abc" should set the property value +Pass e.style['scroll-timeline-name'] = "--aBc" should set the property value +Pass e.style['scroll-timeline-name'] = "--foo, --bar" should set the property value +Pass e.style['scroll-timeline-name'] = "--bar, --foo" should set the property value +Fail e.style['scroll-timeline-name'] = "none, none" should set the property value +Pass e.style['scroll-timeline-name'] = "--a, none, --b" should set the property value +Pass e.style['scroll-timeline-name'] = "auto" should not set the property value +Pass e.style['scroll-timeline-name'] = "abc" should not set the property value +Pass e.style['scroll-timeline-name'] = "default" should not set the property value +Pass e.style['scroll-timeline-name'] = "10px" should not set the property value +Pass e.style['scroll-timeline-name'] = "foo bar" should not set the property value +Pass e.style['scroll-timeline-name'] = "\"foo\" \"bar\"" should not set the property value +Pass e.style['scroll-timeline-name'] = "rgb(1, 2, 3)" should not set the property value +Pass e.style['scroll-timeline-name'] = "#fefefe" 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-name-computed.html b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-computed.html new file mode 100644 index 00000000000..3cf3e3406fe --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-computed.html @@ -0,0 +1,37 @@ + + + + + + + +
+
+
+ diff --git a/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.html b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.html new file mode 100644 index 00000000000..20c5d28e7f6 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/scroll-animations/css/scroll-timeline-name-parsing.html @@ -0,0 +1,32 @@ + + + + + +
+