Explorar el Código

LibWeb: Properly handle `auto` in StyleProperties::length_percentage()

This relied on `auto` being a LengthStyleValue, which soon will not be
true. :^)
Sam Atkins hace 2 años
padre
commit
6bf5371124
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      Userland/Libraries/LibWeb/CSS/StyleProperties.cpp

+ 3 - 0
Userland/Libraries/LibWeb/CSS/StyleProperties.cpp

@@ -114,6 +114,9 @@ Optional<LengthPercentage> StyleProperties::length_percentage(CSS::PropertyID id
     if (value->has_length())
         return value->to_length();
 
+    if (value->has_auto())
+        return LengthPercentage { Length::make_auto() };
+
     return {};
 }