mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb: Canonicalize color space when parsing color-mix()
function
This amounts to replacing the "xyz" color space with "xyz-d65".
This commit is contained in:
parent
7b8af4d84c
commit
8a20899382
Notes:
github-actions[bot]
2025-04-23 10:38:25 +00:00
Author: https://github.com/tcl3
Commit: 8a20899382
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4430
Reviewed-by: https://github.com/gmta ✅
2 changed files with 37 additions and 31 deletions
|
@ -1732,10 +1732,17 @@ RefPtr<CSSStyleValue const> Parser::parse_color_mix_function(TokenStream<Compone
|
|||
return {};
|
||||
color_space = color_space_token.token().ident().to_string();
|
||||
}
|
||||
|
||||
function_tokens.discard_whitespace();
|
||||
|
||||
auto canonical_color_space_name = [](String const& color_space_name) {
|
||||
if (color_space_name == "xyz"sv)
|
||||
return "xyz-d65"_string;
|
||||
return color_space_name;
|
||||
};
|
||||
|
||||
return ColorMixStyleValue::ColorInterpolationMethod {
|
||||
.color_space = color_space,
|
||||
.color_space = canonical_color_space_name(color_space),
|
||||
.hue_interpolation_method = hue_interpolation_method,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue