mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibWeb: Don't assume grid size is always Function or Token
This stops `grid-template-columns: minmax({},{})` from crashing.
This commit is contained in:
parent
1a17b8a304
commit
6cd6186399
3 changed files with 17 additions and 5 deletions
|
@ -5030,14 +5030,13 @@ Optional<CSS::GridSize> Parser::parse_grid_size(ComponentValue const& component_
|
|||
|
||||
return {};
|
||||
}
|
||||
auto token = component_value.token();
|
||||
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_ascii_case("auto"sv))
|
||||
if (component_value.is_ident("auto"sv))
|
||||
return GridSize::make_auto();
|
||||
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_ascii_case("max-content"sv))
|
||||
if (component_value.is_ident("max-content"sv))
|
||||
return GridSize(GridSize::Type::MaxContent);
|
||||
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_ascii_case("min-content"sv))
|
||||
if (component_value.is_ident("min-content"sv))
|
||||
return GridSize(GridSize::Type::MinContent);
|
||||
auto dimension = parse_dimension(token);
|
||||
auto dimension = parse_dimension(component_value);
|
||||
if (!dimension.has_value())
|
||||
return {};
|
||||
if (dimension->is_length())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue