LibWeb: Delete redundant GridFitContent class from track representation

GridSize already supports the FitContent type, so there is no need to
additionally wrap it in a GridFitContent class.
This commit is contained in:
Aliaksandr Kalenik 2025-06-18 15:47:41 +02:00 committed by Sam Atkins
commit 6169e91994
Notes: github-actions[bot] 2025-06-18 14:52:36 +00:00
5 changed files with 12 additions and 42 deletions

View file

@ -283,7 +283,7 @@ private:
Vector<Gfx::UnicodeRange> parse_unicode_ranges(TokenStream<ComponentValue>&);
RefPtr<UnicodeRangeStyleValue const> parse_unicode_range_value(TokenStream<ComponentValue>&);
Optional<GridSize> parse_grid_size(ComponentValue const&);
Optional<GridFitContent> parse_grid_fit_content(Vector<ComponentValue> const&);
Optional<GridSize> parse_grid_fit_content(Vector<ComponentValue> const&);
Optional<GridMinMax> parse_min_max(Vector<ComponentValue> const&);
Optional<GridRepeat> parse_repeat(Vector<ComponentValue> const&);
Optional<ExplicitGridTrack> parse_track_sizing_function(ComponentValue const&);

View file

@ -3243,7 +3243,7 @@ Optional<CSS::GridSize> Parser::parse_grid_size(ComponentValue const& component_
return {};
}
Optional<CSS::GridFitContent> Parser::parse_grid_fit_content(Vector<ComponentValue> const& component_values)
Optional<GridSize> Parser::parse_grid_fit_content(Vector<ComponentValue> const& component_values)
{
// https://www.w3.org/TR/css-grid-2/#valdef-grid-template-columns-fit-content
// 'fit-content( <length-percentage> )'
@ -3254,7 +3254,7 @@ Optional<CSS::GridFitContent> Parser::parse_grid_fit_content(Vector<ComponentVal
function_tokens.discard_whitespace();
auto maybe_length_percentage = parse_length_percentage(function_tokens);
if (maybe_length_percentage.has_value())
return CSS::GridFitContent(CSS::GridSize(CSS::GridSize::Type::FitContent, maybe_length_percentage.value()));
return GridSize(GridSize::Type::FitContent, maybe_length_percentage.value());
return {};
}