From 8e82544dce19f04edb7b6b5c64ec12800d3d2d70 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Wed, 16 Feb 2022 17:19:00 +0000 Subject: [PATCH] LibWeb: Stop treating undefined lengths as valid When converting this code to use Optional, I accidentally left in the initialization, so it *always* had a value, and always created a Length from it. Oops. --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 8d7cd47703..a57996149c 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2149,7 +2149,7 @@ Optional Parser::parse_dimension(StyleComponentValueRule cons if (component_value.is(Token::Type::Dimension)) { float numeric_value = component_value.token().dimension_value(); auto unit_string = component_value.token().dimension_unit(); - Optional length_type = Length::Type::Undefined; + Optional length_type; if (unit_string.equals_ignoring_case("px"sv)) { length_type = Length::Type::Px;