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.
This commit is contained in:
Sam Atkins 2022-02-16 17:19:00 +00:00 committed by Andreas Kling
parent 48edaa2085
commit 8e82544dce
Notes: sideshowbarker 2024-07-18 00:54:03 +09:00

View file

@ -2149,7 +2149,7 @@ Optional<Parser::Dimension> 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 = Length::Type::Undefined;
Optional<Length::Type> length_type;
if (unit_string.equals_ignoring_case("px"sv)) {
length_type = Length::Type::Px;