LibWeb: Support "transparent" CSS color value

This commit is contained in:
Linus Groh 2020-05-13 17:18:36 +01:00 committed by Andreas Kling
parent 57857cd8f6
commit cbd746e3ec
Notes: sideshowbarker 2024-07-19 06:40:17 +09:00

View file

@ -43,6 +43,9 @@ namespace Web {
static Optional<Color> parse_css_color(const StringView& view)
{
if (view.equals_ignoring_case("transparent"))
return Color::from_rgba(0x00000000);
auto color = Color::from_string(view.to_string().to_lowercase());
if (color.has_value())
return color;