1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

LibWeb: Parse min and max-content

Parse min and max-content as well as use its values in the GridTrackSize
class.
This commit is contained in:
martinfalisse 2023-01-16 17:33:30 +01:00 committed by Andreas Kling
parent 9d99bd8258
commit 0448547553
3 changed files with 23 additions and 4 deletions

View file

@ -5934,6 +5934,10 @@ Optional<CSS::GridSize> Parser::parse_grid_size(ComponentValue const& component_
}
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_case("auto"sv))
return GridSize::make_auto();
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_case("max-content"sv))
return GridSize(GridSize::Type::MaxContent);
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_case("min-content"sv))
return GridSize(GridSize::Type::MinContent);
auto dimension = parse_dimension(token);
if (!dimension.has_value())
return {};