From 6bf537112465288e7ec1e46c7c143f8fa5f52e53 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 19 Apr 2023 11:26:49 +0100 Subject: [PATCH] LibWeb: Properly handle `auto` in StyleProperties::length_percentage() This relied on `auto` being a LengthStyleValue, which soon will not be true. :^) --- Userland/Libraries/LibWeb/CSS/StyleProperties.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index 1ef078017f..da2bf77e66 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -114,6 +114,9 @@ Optional StyleProperties::length_percentage(CSS::PropertyID id if (value->has_length()) return value->to_length(); + if (value->has_auto()) + return LengthPercentage { Length::make_auto() }; + return {}; }