From f8e82da4b4b377a4193a716556219a0ae8c0090c Mon Sep 17 00:00:00 2001 From: martinfalisse Date: Fri, 26 Aug 2022 10:37:59 +0200 Subject: [PATCH] LibWeb: Handle unknown values in grid-template-* This commit fixes a bug found when passing exotic values in the grid-template-columns (or grid-template-rows) which are not yet supported. The bug seems to have been something like: grid-template-columns: 0 minmax(0, calc(10px - var(--some-color))); --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 6e6357ea32..2c09f36687 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -5306,22 +5306,22 @@ RefPtr Parser::parse_grid_track_sizes(Vector const& Vector params; for (auto& component_value : component_values) { // FIXME: Incomplete as a GridTrackSize can be a function like minmax(min, max), etc. - if (component_value.is_function()) - return {}; + if (component_value.is_function()) { + params.append(Length::make_auto()); + continue; + } if (component_value.is(Token::Type::Ident) && component_value.token().ident().equals_ignoring_case("auto"sv)) { params.append(Length::make_auto()); continue; } auto dimension = parse_dimension(component_value); if (!dimension.has_value()) - return {}; + return GridTrackSizeStyleValue::create({}); if (dimension->is_length()) params.append(dimension->length()); if (dimension->is_percentage()) params.append(dimension->percentage()); } - if (params.size() == 0) - return {}; return GridTrackSizeStyleValue::create(params); }