LibWeb: Add SVG paint fallback color support to CSS parsing

This commit is contained in:
Tim Ledbetter
2026-02-17 15:48:31 +00:00
committed by Jelle Raaijmakers
parent f13a26d68e
commit 804287847a
Notes: github-actions[bot] 2026-02-27 16:16:30 +00:00
8 changed files with 52 additions and 11 deletions

View File

@@ -2873,8 +2873,9 @@ RefPtr<StyleValue const> Parser::parse_paint_value(TokenStream<ComponentValue>&
tokens.discard_whitespace();
if (auto color_or_none = parse_color_or_none(); color_or_none == nullptr) {
// Fail to parse if the fallback is invalid, but otherwise ignore it.
// FIXME: Use fallback color
return nullptr;
} else if (color_or_none.has_value() && *color_or_none && (*color_or_none)->has_color()) {
return URLStyleValue::create(url->as_url().url(), color_or_none->release_nonnull());
}
return url;
}