diff --git a/Tests/LibWeb/Layout/expected/grid/css-calc-in-grid-position.txt b/Tests/LibWeb/Layout/expected/grid/css-calc-in-grid-position.txt new file mode 100644 index 0000000000..8268a1b115 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/grid/css-calc-in-grid-position.txt @@ -0,0 +1,63 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x50 [BFC] children: not-inline + Box at (8,8) content-size 600x34 [GFC] children: not-inline + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + TextNode <#text> + BlockContainer at (8,8) content-size 198.25x17 [BFC] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [8,8 45.578125x17] baseline: 13.296875 + "title 1" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + BlockContainer at (8,25) content-size 198.25x17 [BFC] children: inline + frag 0 from TextNode start: 0, length: 6, rect: [8,25 46.484375x17] baseline: 13.296875 + "text 1" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + TextNode <#text> + TextNode <#text> + BlockContainer at (206.25,8) content-size 200.71875x17 [BFC] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [206.25,8 48.046875x17] baseline: 13.296875 + "title 2" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + BlockContainer at (206.25,25) content-size 200.71875x17 [BFC] children: inline + frag 0 from TextNode start: 0, length: 6, rect: [206.25,25 48.953125x17] baseline: 13.296875 + "text 2" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + TextNode <#text> + TextNode <#text> + BlockContainer at (406.96875,8) content-size 201x17 [BFC] children: inline + frag 0 from TextNode start: 0, length: 7, rect: [406.96875,8 48.328125x17] baseline: 13.296875 + "title 3" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + BlockContainer at (406.96875,25) content-size 201x17 [BFC] children: inline + frag 0 from TextNode start: 0, length: 6, rect: [406.96875,25 49.234375x17] baseline: 13.296875 + "text 3" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) [BFC] children: inline + TextNode <#text> + TextNode <#text> + +ViewportPaintable (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x50] + PaintableBox (Box) [8,8 600x34] + PaintableWithLines (BlockContainer
.title) [8,8 198.25x17] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
.text) [8,25 198.25x17] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
.title) [206.25,8 200.71875x17] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
.text) [206.25,25 200.71875x17] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
.title) [406.96875,8 201x17] + TextPaintable (TextNode<#text>) + PaintableWithLines (BlockContainer
.text) [406.96875,25 201x17] + TextPaintable (TextNode<#text>) diff --git a/Tests/LibWeb/Layout/input/grid/css-calc-in-grid-position.html b/Tests/LibWeb/Layout/input/grid/css-calc-in-grid-position.html new file mode 100644 index 0000000000..d6b590d3fa --- /dev/null +++ b/Tests/LibWeb/Layout/input/grid/css-calc-in-grid-position.html @@ -0,0 +1,34 @@ + + +
+
title 1
+
text 1
+
+
+
title 2
+
text 2
+
+
+
title 3
+
text 3
+
+ \ No newline at end of file diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 161e8e2d7e..2f2ae95e05 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -5692,6 +5692,10 @@ RefPtr Parser::parse_grid_track_placement(TokenStreamresolves_to_number()) { + transaction.commit(); + return GridTrackPlacementStyleValue::create(GridTrackPlacement::make_line(static_cast(maybe_calculated->resolve_integer().value()), {})); + } if (token.is_ident("auto"sv)) { transaction.commit(); return GridTrackPlacementStyleValue::create(GridTrackPlacement::make_auto());