Explorar o código

LibWeb: Support "transparent" CSS color value

Linus Groh %!s(int64=5) %!d(string=hai) anos
pai
achega
cbd746e3ec
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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)
 {
+    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;