summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-05-13 17:18:36 +0100
committerAndreas Kling <kling@serenityos.org>2020-05-13 19:25:49 +0200
commitcbd746e3ecb69a2fc00aa543ae22df9ee94bd04f (patch)
treea20f8a8e9fce009f94a22c89e0e65442214c290a
parent57857cd8f69cd78516a0cccf7fd58d2bdd249ca1 (diff)
downloadserenity-cbd746e3ecb69a2fc00aa543ae22df9ee94bd04f.zip
LibWeb: Support "transparent" CSS color value
-rw-r--r--Libraries/LibWeb/Parser/CSSParser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Parser/CSSParser.cpp b/Libraries/LibWeb/Parser/CSSParser.cpp
index 5fe882fc82..7820209ae7 100644
--- a/Libraries/LibWeb/Parser/CSSParser.cpp
+++ b/Libraries/LibWeb/Parser/CSSParser.cpp
@@ -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;