Browse Source

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

This relied on `auto` being a LengthStyleValue, which soon will not be
true. :^)
Sam Atkins 2 years ago
parent
commit
6bf5371124
1 changed files with 3 additions and 0 deletions
  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 {};
 }