summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-04-19 11:26:49 +0100
committerAndreas Kling <kling@serenityos.org>2023-04-19 18:25:18 +0200
commit6bf537112465288e7ec1e46c7c143f8fa5f52e53 (patch)
tree71fdaca42560db370d0cb1694a28003ff399fc2e /Userland/Libraries/LibWeb
parent22cb74d9ffc82f8ee59357c8db131048d8691a2a (diff)
downloadserenity-6bf537112465288e7ec1e46c7c143f8fa5f52e53.zip
LibWeb: Properly handle `auto` in StyleProperties::length_percentage()
This relied on `auto` being a LengthStyleValue, which soon will not be true. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleProperties.cpp3
1 files changed, 3 insertions, 0 deletions
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<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 {};
}