diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-04-19 11:26:49 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-04-19 18:25:18 +0200 |
commit | 6bf537112465288e7ec1e46c7c143f8fa5f52e53 (patch) | |
tree | 71fdaca42560db370d0cb1694a28003ff399fc2e /Userland/Libraries/LibWeb | |
parent | 22cb74d9ffc82f8ee59357c8db131048d8691a2a (diff) | |
download | serenity-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.cpp | 3 |
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 {}; } |