mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
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:
parent
48edaa2085
commit
8e82544dce
Notes:
sideshowbarker
2024-07-18 00:54:03 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/8e82544dce Pull-request: https://github.com/SerenityOS/serenity/pull/12585
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue