mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Store CSS color name in CSSRGB
When serializing an sRGB color value that originated from a named color, it should return the color name converted to ASCII lowercase. This requires storing the color name (if it has one). This change also requires explicitly removing the color names when computing style, because computed color values do not retain their name. It also requires removing a caching optimization in create_from_color(), because adding the name means that the cached value might be wrong. This fixes some WPT subtests, and also required updating some of our own tests.
This commit is contained in:
parent
ff311c1560
commit
6bb8bf189f
Notes:
github-actions[bot]
2024-11-25 10:52:53 +00:00
Author: https://github.com/milotier
Commit: 6bb8bf189f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2551
Reviewed-by: https://github.com/tcl3
16 changed files with 133 additions and 69 deletions
|
@ -3413,7 +3413,7 @@ RefPtr<CSSStyleValue> Parser::parse_color_value(TokenStream<ComponentValue>& tok
|
|||
auto color = Color::from_string(ident);
|
||||
if (color.has_value()) {
|
||||
transaction.commit();
|
||||
return CSSColorValue::create_from_color(color.release_value());
|
||||
return CSSColorValue::create_from_color(color.release_value(), ident);
|
||||
}
|
||||
// Otherwise, fall through to the hashless-hex-color case
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue