mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 14:27:35 +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
|
@ -0,0 +1,12 @@
|
||||||
|
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
||||||
|
BlockContainer <html> at (0,0) content-size 800x600 [BFC] children: not-inline
|
||||||
|
BlockContainer <body> at (8,8) content-size 784x0 children: not-inline
|
||||||
|
BlockContainer <div> at (8,8) content-size 784x0 children: not-inline
|
||||||
|
BlockContainer <(anonymous)> at (8,16) content-size 784x0 children: inline
|
||||||
|
TextNode <#text>
|
||||||
|
|
||||||
|
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
||||||
|
PaintableWithLines (BlockContainer<HTML>) [0,0 800x600]
|
||||||
|
PaintableWithLines (BlockContainer<BODY>) [8,8 784x0] overflow: [8,16 784x0]
|
||||||
|
PaintableWithLines (BlockContainer<DIV>) [8,8 784x0]
|
||||||
|
PaintableWithLines (BlockContainer(anonymous)) [8,16 784x0]
|
|
@ -0,0 +1 @@
|
||||||
|
<div style="grid-template-columns: minmax({},{})"></div>
|
|
@ -5030,14 +5030,13 @@ Optional<CSS::GridSize> Parser::parse_grid_size(ComponentValue const& component_
|
||||||
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
auto token = component_value.token();
|
if (component_value.is_ident("auto"sv))
|
||||||
if (token.is(Token::Type::Ident) && token.ident().equals_ignoring_ascii_case("auto"sv))
|
|
||||||
return GridSize::make_auto();
|
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);
|
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);
|
return GridSize(GridSize::Type::MinContent);
|
||||||
auto dimension = parse_dimension(token);
|
auto dimension = parse_dimension(component_value);
|
||||||
if (!dimension.has_value())
|
if (!dimension.has_value())
|
||||||
return {};
|
return {};
|
||||||
if (dimension->is_length())
|
if (dimension->is_length())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue