mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02: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:
committed by
Jelle Raaijmakers
parent
7b8af4d84c
commit
8a20899382
Notes:
github-actions[bot]
2025-04-23 10:38:25 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/8a208993823 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4430 Reviewed-by: https://github.com/gmta ✅
@@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user