LibWeb/CSS: Parse mask-composite property

This commit is contained in:
InvalidUsernameException 2025-07-18 20:36:06 +02:00 committed by Sam Atkins
parent d51f46a0f7
commit 22d7a58998
10 changed files with 41 additions and 13 deletions

View File

@ -136,6 +136,12 @@
"none",
"all"
],
"compositing-operator": [
"add",
"subtract",
"intersect",
"exclude"
],
"contain": [
"none",
"strict",

View File

@ -71,6 +71,7 @@
"activeborder",
"activecaption",
"activetext",
"add",
"additive",
"alias",
"all",
@ -190,6 +191,7 @@
"end",
"evenodd",
"ew-resize",
"exclude",
"exclusion",
"expanded",
"extra-condensed",
@ -265,6 +267,7 @@
"inter-character",
"inter-word",
"interlace",
"intersect",
"invert",
"inverted",
"isolate",
@ -493,6 +496,7 @@
"stroke-box",
"style",
"sub",
"subtract",
"subtractive",
"super",
"sw-resize",

View File

@ -664,6 +664,10 @@ Parser::ParseErrorOr<NonnullRefPtr<CSSStyleValue const>> Parser::parse_css_value
if (auto parsed_value = parse_math_depth_value(tokens); parsed_value && !tokens.has_next_token())
return parsed_value.release_nonnull();
return ParseError::SyntaxError;
case PropertyID::MaskComposite:
if (auto parsed_value = parse_simple_comma_separated_value_list(property_id, tokens))
return parsed_value.release_nonnull();
return ParseError::SyntaxError;
case PropertyID::Opacity:
case PropertyID::FillOpacity:
case PropertyID::FloodOpacity:

View File

@ -2383,6 +2383,15 @@
"mask-image"
]
},
"mask-composite": {
"animation-type": "discrete",
"inherited": false,
"affects-layout": false,
"valid-types": [
"compositing-operator"
],
"initial": "add"
},
"mask-image": {
"animation-type": "discrete",
"inherited": false,

View File

@ -186,6 +186,7 @@ All properties associated with getComputedStyle(document.body):
"margin-left",
"margin-right",
"margin-top",
"mask-composite",
"mask-image",
"mask-type",
"max-block-size",

View File

@ -525,6 +525,8 @@ All supported properties and their default values exposed from CSSStylePropertie
'marginTop': '8px'
'margin-top': '8px'
'mask': 'none'
'maskComposite': 'add'
'mask-composite': 'add'
'maskImage': 'none'
'mask-image': 'none'
'maskType': 'luminance'

View File

@ -184,6 +184,7 @@ margin-inline-start: 8px
margin-left: 8px
margin-right: 8px
margin-top: 8px
mask-composite: add
mask-image: none
mask-type: luminance
max-block-size: none

View File

@ -1,8 +1,8 @@
Harness status: OK
Found 248 tests
Found 249 tests
241 Pass
242 Pass
7 Fail
Pass accent-color
Pass border-collapse
@ -185,6 +185,7 @@ Pass margin-inline-start
Pass margin-left
Pass margin-right
Pass margin-top
Pass mask-composite
Pass mask-image
Pass mask-type
Pass max-block-size

View File

@ -2,8 +2,8 @@ Harness status: OK
Found 4 tests
4 Fail
Fail Property mask-composite value 'add'
Fail Property mask-composite value 'subtract'
Fail Property mask-composite value 'intersect'
Fail Property mask-composite value 'exclude'
4 Pass
Pass Property mask-composite value 'add'
Pass Property mask-composite value 'subtract'
Pass Property mask-composite value 'intersect'
Pass Property mask-composite value 'exclude'

View File

@ -2,9 +2,9 @@ Harness status: OK
Found 5 tests
5 Fail
Fail e.style['mask-composite'] = "add" should set the property value
Fail e.style['mask-composite'] = "subtract" should set the property value
Fail e.style['mask-composite'] = "intersect" should set the property value
Fail e.style['mask-composite'] = "exclude" should set the property value
Fail e.style['mask-composite'] = "add, subtract" should set the property value
5 Pass
Pass e.style['mask-composite'] = "add" should set the property value
Pass e.style['mask-composite'] = "subtract" should set the property value
Pass e.style['mask-composite'] = "intersect" should set the property value
Pass e.style['mask-composite'] = "exclude" should set the property value
Pass e.style['mask-composite'] = "add, subtract" should set the property value