Browse Source

LibWeb: Support "transparent" CSS color value

Linus Groh 5 years ago
parent
commit
cbd746e3ec
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Libraries/LibWeb/Parser/CSSParser.cpp

+ 3 - 0
Libraries/LibWeb/Parser/CSSParser.cpp

@@ -43,6 +43,9 @@ namespace Web {
 
 
 static Optional<Color> parse_css_color(const StringView& view)
 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());
     auto color = Color::from_string(view.to_string().to_lowercase());
     if (color.has_value())
     if (color.has_value())
         return color;
         return color;