From eea6792cf7f0a8e6f1d984516b4fa132516ae717 Mon Sep 17 00:00:00 2001 From: InvalidUsernameException Date: Fri, 18 Jul 2025 20:36:11 +0200 Subject: [PATCH] LibWeb/CSS: Parse mask-origin property --- Libraries/LibWeb/CSS/Enums.json | 8 ++++++++ Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp | 1 + Libraries/LibWeb/CSS/Properties.json | 9 +++++++++ .../CSSStyleDeclaration-has-indexed-property-getter.txt | 1 + ...rties-all-supported-properties-and-default-values.txt | 2 ++ .../Text/expected/css/getComputedStyle-print-all.txt | 1 + .../wpt-import/css/css-cascade/all-prop-revert-layer.txt | 5 +++-- 7 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/CSS/Enums.json b/Libraries/LibWeb/CSS/Enums.json index 12980d5ccbd..d8ffedd9b3b 100644 --- a/Libraries/LibWeb/CSS/Enums.json +++ b/Libraries/LibWeb/CSS/Enums.json @@ -157,6 +157,14 @@ "auto", "hidden" ], + "coord-box": [ + "content-box", + "padding-box", + "border-box", + "fill-box", + "stroke-box", + "view-box" + ], "counter-style-name-keyword": [ "circle", "decimal", diff --git a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp index 40d21f29988..9983335cf72 100644 --- a/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/PropertyParsing.cpp @@ -666,6 +666,7 @@ Parser::ParseErrorOr> Parser::parse_css_value return ParseError::SyntaxError; case PropertyID::MaskComposite: case PropertyID::MaskMode: + case PropertyID::MaskOrigin: if (auto parsed_value = parse_simple_comma_separated_value_list(property_id, tokens)) return parsed_value.release_nonnull(); return ParseError::SyntaxError; diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index 6161cec5750..0d926fae8be 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -2415,6 +2415,15 @@ ], "initial": "match-source" }, + "mask-origin": { + "animation-type": "discrete", + "inherited": false, + "affects-layout": false, + "valid-types": [ + "coord-box" + ], + "initial": "border-box" + }, "mask-position": { "animation-type": "repeatable-list", "affects-layout": false, 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 8416f32f544..2fc5fe0c05f 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 @@ -189,6 +189,7 @@ All properties associated with getComputedStyle(document.body): "mask-composite", "mask-image", "mask-mode", + "mask-origin", "mask-position", "mask-repeat", "mask-size", 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 b0ca40e09c8..57d367eb2e9 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 @@ -531,6 +531,8 @@ All supported properties and their default values exposed from CSSStylePropertie 'mask-image': 'none' 'maskMode': 'match-source' 'mask-mode': 'match-source' +'maskOrigin': 'border-box' +'mask-origin': 'border-box' 'maskPosition': '0% 0%' 'mask-position': '0% 0%' 'maskRepeat': 'repeat' diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 3dae0b74986..7c4b9598d5e 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -187,6 +187,7 @@ margin-top: 8px mask-composite: add mask-image: none mask-mode: match-source +mask-origin: border-box mask-position: 0% 0% mask-repeat: repeat mask-size: auto 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 3e187313bd4..c329f299c3d 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 252 tests +Found 253 tests -245 Pass +246 Pass 7 Fail Pass accent-color Pass border-collapse @@ -188,6 +188,7 @@ Pass margin-top Pass mask-composite Pass mask-image Pass mask-mode +Pass mask-origin Pass mask-repeat Pass mask-size Pass mask-type