From 493c6cf0fd7da762cd285d67c44b690f59c41c5c Mon Sep 17 00:00:00 2001 From: martinfalisse Date: Wed, 7 Sep 2022 14:57:47 +0200 Subject: [PATCH] LibWeb: Parse flexible length values for GridTrackSizes Fix a bug as well as implement new functionality by parsing flexible length values for GridTrackSizes. --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index dae4505fe6..f8cb5b1b0c 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -5329,6 +5329,15 @@ RefPtr Parser::parse_grid_track_sizes(Vector const& params.append(Length::make_auto()); continue; } + if (component_value.token().type() == Token::Type::Dimension) { + float numeric_value = component_value.token().dimension_value(); + auto unit_string = component_value.token().dimension_unit(); + if (unit_string.equals_ignoring_case("fr"sv) && numeric_value) { + params.append(GridTrackSize(numeric_value)); + continue; + } + } + auto dimension = parse_dimension(component_value); if (!dimension.has_value()) return GridTrackSizeStyleValue::create({});