summaryrefslogtreecommitdiff
path: root/Tests/LibWeb/Layout
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/LibWeb/Layout')
-rw-r--r--Tests/LibWeb/Layout/expected/grid/auto-fill.txt27
-rw-r--r--Tests/LibWeb/Layout/expected/grid/auto-fit.txt27
-rw-r--r--Tests/LibWeb/Layout/expected/grid/basic.txt34
-rw-r--r--Tests/LibWeb/Layout/expected/grid/different-column-sizes.txt34
-rw-r--r--Tests/LibWeb/Layout/expected/grid/gap.txt102
-rw-r--r--Tests/LibWeb/Layout/expected/grid/image-in-grid.txt14
-rw-r--r--Tests/LibWeb/Layout/expected/grid/min-max-content.txt27
-rw-r--r--Tests/LibWeb/Layout/expected/grid/minmax.txt168
-rw-r--r--Tests/LibWeb/Layout/expected/grid/named-tracks.txt90
-rw-r--r--Tests/LibWeb/Layout/expected/grid/positions-and-spans.txt83
-rw-r--r--Tests/LibWeb/Layout/expected/grid/repeat.txt83
-rw-r--r--Tests/LibWeb/Layout/expected/grid/template-areas.txt83
-rw-r--r--Tests/LibWeb/Layout/input/grid/auto-fill.html22
-rw-r--r--Tests/LibWeb/Layout/input/grid/auto-fit.html22
-rw-r--r--Tests/LibWeb/Layout/input/grid/basic.html22
-rw-r--r--Tests/LibWeb/Layout/input/grid/different-column-sizes.html24
-rw-r--r--Tests/LibWeb/Layout/input/grid/gap.html62
-rw-r--r--Tests/LibWeb/Layout/input/grid/image-in-grid.html32
-rw-r--r--Tests/LibWeb/Layout/input/grid/min-max-content.html23
-rw-r--r--Tests/LibWeb/Layout/input/grid/minmax.html75
-rw-r--r--Tests/LibWeb/Layout/input/grid/named-tracks.html62
-rw-r--r--Tests/LibWeb/Layout/input/grid/positions-and-spans.html67
-rw-r--r--Tests/LibWeb/Layout/input/grid/repeat.html41
-rw-r--r--Tests/LibWeb/Layout/input/grid/template-areas.html63
24 files changed, 1287 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/grid/auto-fill.txt b/Tests/LibWeb/Layout/expected/grid/auto-fill.txt
new file mode 100644
index 0000000000..09f5a41d7d
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/auto-fill.txt
@@ -0,0 +1,27 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x33.46875 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x17.46875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 261.333343x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (269.333343,8) content-size 261.333343x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [269.333343,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (530.666687,8) content-size 261.333312x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [530.666687,8 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/auto-fit.txt b/Tests/LibWeb/Layout/expected/grid/auto-fit.txt
new file mode 100644
index 0000000000..09f5a41d7d
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/auto-fit.txt
@@ -0,0 +1,27 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x33.46875 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x17.46875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 261.333343x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (269.333343,8) content-size 261.333343x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [269.333343,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (530.666687,8) content-size 261.333312x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [530.666687,8 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/basic.txt b/Tests/LibWeb/Layout/expected/grid/basic.txt
new file mode 100644
index 0000000000..f81bd57e1a
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/basic.txt
@@ -0,0 +1,34 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x50.9375 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x34.9375 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 392.140625x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (400.140625,8) content-size 392x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [400.140625,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,25.46875) content-size 392.140625x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,25.46875 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (400.140625,25.46875) content-size 392x17.46875 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [400.140625,25.46875 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/different-column-sizes.txt b/Tests/LibWeb/Layout/expected/grid/different-column-sizes.txt
new file mode 100644
index 0000000000..49d3b9ab9e
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/different-column-sizes.txt
@@ -0,0 +1,34 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x50.9375 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x34.9375 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 50x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (58,8) content-size 392x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [58,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,25.46875) content-size 50x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,25.46875 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (58,25.46875) content-size 392x17.46875 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [58,25.46875 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/gap.txt b/Tests/LibWeb/Layout/expected/grid/gap.txt
new file mode 100644
index 0000000000..3bf3f017a4
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/gap.txt
@@ -0,0 +1,102 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x166.8125 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x150.8125 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x44.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 367.140625x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (425.140625,8) content-size 367x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [425.140625,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,35.46875) content-size 367.140625x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,35.46875 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (425.140625,35.46875) content-size 367x17.46875 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [425.140625,35.46875 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,52.9375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,52.9375) content-size 784x50.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,52.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (435.434356,52.9375) content-size 357.800018x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [435.434356,52.9375 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,52.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,86.40625) content-size 359.034362x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,86.40625 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,52.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,103.875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,103.875) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,103.875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (408,103.875) content-size 384x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [408,103.875 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,103.875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,121.34375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,121.34375) content-size 784x20 children: not-inline
+ BlockContainer <(anonymous)> at (8,121.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (408,121.34375) content-size 384x20 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [408,121.34375 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,121.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,141.34375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container.with-border> at (8,141.34375) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,141.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item.with-border> at (8,141.34375) content-size 387x17.46875 children: inline
+ line 0 width: 104.875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 14, rect: [8,141.34375 104.875x17.46875]
+ "left side text"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,141.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item.with-border> at (405,141.34375) content-size 387x17.46875 children: inline
+ line 0 width: 363.203125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 47, rect: [405,141.34375 363.203125x17.46875]
+ "right side text right side text right side text"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,141.34375) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/image-in-grid.txt b/Tests/LibWeb/Layout/expected/grid/image-in-grid.txt
new file mode 100644
index 0000000000..a16f899a64
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/image-in-grid.txt
@@ -0,0 +1,14 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x40 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x24 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x24 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.wrapper> at (8,8) content-size 64x24 children: inline
+ line 0 width: 64, height: 24, bottom: 24, baseline: 24
+ frag 0 from ImageBox start: 0, length: 0, rect: [8,8 64x24]
+ TextNode <#text>
+ ImageBox <img> at (8,8) content-size 64x24 children: not-inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/min-max-content.txt b/Tests/LibWeb/Layout/expected/grid/min-max-content.txt
new file mode 100644
index 0000000000..cd41b7000d
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/min-max-content.txt
@@ -0,0 +1,27 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x33.46875 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x17.46875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 93.765625x17.46875 children: inline
+ line 0 width: 93.765625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 11, rect: [8,8 93.765625x17.46875]
+ "min-content"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (101.765625,8) content-size 98.640625x17.46875 children: inline
+ line 0 width: 98.640625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 11, rect: [101.765625,8 98.640625x17.46875]
+ "max-content"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (200.40625,8) content-size 591.59375x17.46875 children: inline
+ line 0 width: 21.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 3, rect: [200.40625,8 21.609375x17.46875]
+ "1fr"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/minmax.txt b/Tests/LibWeb/Layout/expected/grid/minmax.txt
new file mode 100644
index 0000000000..3935b3cc0e
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/minmax.txt
@@ -0,0 +1,168 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x288.28125 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x272.28125 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 300x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (308,8) content-size 300x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [308,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,25.46875) content-size 784x100 children: not-inline
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,25.46875) content-size 300x50 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,25.46875 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (308,25.46875) content-size 300x50 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [308,25.46875 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,125.46875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,125.46875) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,125.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,125.46875) content-size 784x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,125.46875 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,125.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,142.9375) content-size 784x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,142.9375 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,125.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,160.40625) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,160.40625) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,160.40625) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,160.40625) content-size 784x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,160.40625 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,160.40625) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,177.875) content-size 784x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,177.875 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,160.40625) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,195.34375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,195.34375) content-size 784x50 children: not-inline
+ BlockContainer <(anonymous)> at (8,195.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,195.34375) content-size 300x25 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,195.34375 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,195.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (308,195.34375) content-size 300x25 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [308,195.34375 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,195.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,220.34375) content-size 300x25 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,220.34375 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,195.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (308,220.34375) content-size 300x25 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [308,220.34375 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,195.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,245.34375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,245.34375) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,245.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,245.34375) content-size 261.333343x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,245.34375 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,245.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (269.333343,245.34375) content-size 261.333343x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [269.333343,245.34375 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,245.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (530.666687,245.34375) content-size 261.333312x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [530.666687,245.34375 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,245.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,262.8125) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,262.8125) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,262.8125) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,262.8125) content-size 56.218711x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,262.8125 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,262.8125) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (64.218711,262.8125) content-size 671.5625x17.46875 children: inline
+ line 0 width: 125.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 15, rect: [64.218711,262.8125 125.265625x17.46875]
+ "Article content"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,262.8125) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (735.781188,262.8125) content-size 56.218688x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [735.781188,262.8125 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,262.8125) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/named-tracks.txt b/Tests/LibWeb/Layout/expected/grid/named-tracks.txt
new file mode 100644
index 0000000000..174763be8d
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/named-tracks.txt
@@ -0,0 +1,90 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x143.40625 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x127.40625 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 392x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (400,8) content-size 393.234375x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [400,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,25.46875) content-size 784x75 children: not-inline
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,25.46875) content-size 261.333343x75 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,25.46875 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (530.666687,25.46875) content-size 261.333312x50 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [530.666687,25.46875 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (269.333343,25.46875) content-size 261.333343x25 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [269.333343,25.46875 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (269.333343,75.46875) content-size 522.666625x25 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [269.333343,75.46875 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,100.46875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,100.46875) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,100.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (58,100.46875) content-size 100x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [58,100.46875 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,100.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (158,100.46875) content-size 50x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [158,100.46875 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,100.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (208,100.46875) content-size 100x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [208,100.46875 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,100.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,117.9375) content-size 50x17.46875 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,117.9375 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,100.46875) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/positions-and-spans.txt b/Tests/LibWeb/Layout/expected/grid/positions-and-spans.txt
new file mode 100644
index 0000000000..f3a5bfb7d4
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/positions-and-spans.txt
@@ -0,0 +1,83 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x185.875 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x169.875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 522.666748x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (530.666748,8) content-size 261.333496x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [530.666748,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,25.46875) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,25.46875) content-size 261.333374x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,25.46875 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (269.333374,25.46875) content-size 522.66687x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [269.333374,25.46875 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,42.9375) content-size 784x100 children: not-inline
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,42.9375) content-size 784x40 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,42.9375 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,82.9375) content-size 784x60 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,82.9375 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,142.9375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,142.9375) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,142.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,142.9375) content-size 784x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,142.9375 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,142.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,160.40625) content-size 392x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,160.40625 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,142.9375) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/repeat.txt b/Tests/LibWeb/Layout/expected/grid/repeat.txt
new file mode 100644
index 0000000000..f6bbc653b9
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/repeat.txt
@@ -0,0 +1,83 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x233.46875 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x217.46875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x200 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,8) content-size 392x200 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,8 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (400,8) content-size 392x100 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [400,8 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (400,108) content-size 196x50 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [400,108 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (596,108) content-size 196x50 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [596,108 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (400,158) content-size 196x50 children: inline
+ line 0 width: 8.453125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [400,158 8.453125x17.46875]
+ "5"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (596,158) content-size 196x50 children: inline
+ line 0 width: 8.734375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [596,158 8.734375x17.46875]
+ "6"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,208) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,208) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,208) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,208) content-size 50x17.46875 children: inline
+ line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [8,208 6.34375x17.46875]
+ "1"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,208) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (58,208) content-size 50x17.46875 children: inline
+ line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [58,208 8.8125x17.46875]
+ "2"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,208) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (108,208) content-size 100x17.46875 children: inline
+ line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [108,208 9.09375x17.46875]
+ "3"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,208) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (208,208) content-size 100x17.46875 children: inline
+ line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [208,208 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,208) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/expected/grid/template-areas.txt b/Tests/LibWeb/Layout/expected/grid/template-areas.txt
new file mode 100644
index 0000000000..b4fa315ca8
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/template-areas.txt
@@ -0,0 +1,83 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x120.8125 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x104.8125 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x34.9375 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div> at (400,25.46875) content-size 392x17.46875 children: inline
+ line 0 width: 99.703125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 1, length: 12, rect: [400,25.46875 99.703125x17.46875]
+ "right-bottom"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div> at (8,8) content-size 392x34.9375 children: inline
+ line 0 width: 26.25, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 4, rect: [8,8 26.25x17.46875]
+ "left"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div> at (400,8) content-size 392x17.46875 children: inline
+ line 0 width: 70.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 9, rect: [400,8 70.234375x17.46875]
+ "right-top"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,42.9375) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,42.9375) content-size 261.333343x17.46875 children: inline
+ line 0 width: 21.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 3, rect: [8,42.9375 21.609375x17.46875]
+ "1fr"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,42.9375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,60.40625) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,60.40625) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,60.40625) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,60.40625) content-size 392x17.46875 children: inline
+ line 0 width: 21.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 3, rect: [8,60.40625 21.609375x17.46875]
+ "1fr"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,60.40625) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,77.875) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,77.875) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,77.875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,77.875) content-size 196x17.46875 children: inline
+ line 0 width: 21.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 3, rect: [8,77.875 21.609375x17.46875]
+ "1fr"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,77.875) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,95.34375) content-size 784x0 children: inline
+ TextNode <#text>
+ TextNode <#text>
+ TextNode <#text>
+ Box <div.grid-container> at (8,95.34375) content-size 784x17.46875 children: not-inline
+ BlockContainer <(anonymous)> at (8,95.34375) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.grid-item> at (8,95.34375) content-size 196x17.46875 children: inline
+ line 0 width: 21.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 3, rect: [8,95.34375 21.609375x17.46875]
+ "1fr"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,95.34375) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/grid/auto-fill.html b/Tests/LibWeb/Layout/input/grid/auto-fill.html
new file mode 100644
index 0000000000..93351882ff
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/auto-fill.html
@@ -0,0 +1,22 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<div class="grid-container" style="
+ grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/auto-fit.html b/Tests/LibWeb/Layout/input/grid/auto-fit.html
new file mode 100644
index 0000000000..9738e847e8
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/auto-fit.html
@@ -0,0 +1,22 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<div class="grid-container" style="
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/basic.html b/Tests/LibWeb/Layout/input/grid/basic.html
new file mode 100644
index 0000000000..c4fc38a396
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/basic.html
@@ -0,0 +1,22 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Should render a 2x2 grid -->
+<div class="grid-container" style="grid-template-columns: auto auto;">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+ <div class="grid-item">4</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/different-column-sizes.html b/Tests/LibWeb/Layout/input/grid/different-column-sizes.html
new file mode 100644
index 0000000000..0a0d36b0ff
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/different-column-sizes.html
@@ -0,0 +1,24 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Should render a 2x2 grid with columns 50px and 50% -->
+<div class="grid-container" style="
+ grid-template-columns: 50px 50%;
+ grid-template-rows: auto auto;">
+ <div class="grid-item" style="grid-column: 1 / 1; grid-row: 1 / 1">1</div>
+ <div class="grid-item" style="grid-column: 2 / 2; grid-row: 1 / 1">2</div>
+ <div class="grid-item" style="grid-column: 1 / 1; grid-row: 2 / 2">3</div>
+ <div class="grid-item" style="grid-column: 2 / 2; grid-row: 2 / 2">4</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/gap.html b/Tests/LibWeb/Layout/input/grid/gap.html
new file mode 100644
index 0000000000..9dd5f6f5fd
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/gap.html
@@ -0,0 +1,62 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- There should be a large (50px) column gap and small (10px) row gap -->
+<div class="grid-container" style="
+ grid-template-columns: auto auto;
+ gap: 10px 50px;
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+ <div class="grid-item">4</div>
+</div>
+
+<!-- There should be a Z-shaped gap (with both vertical and horizontal gap) -->
+<div class="grid-container" style="
+ grid-template-columns: auto auto;
+ gap: calc(1vh + 10px) calc(10% - 10px);
+ ">
+ <div class="grid-item" style="grid-column: 2 / span 1">1</div>
+ <div class="grid-item">2</div>
+</div>
+
+<!-- Column-gaps with overflowing column spans -->
+<!-- There should be 1 column that starts at column 2 and spans until the end. -->
+<div class="grid-container" style="
+ grid-column-gap: 16px;
+ grid-template-columns: 1fr 1fr;
+ ">
+ <div class="grid-item" style="grid-column: 2 / span 5;">1</div>
+</div>
+
+<!-- Column-gaps with overflowing column spans and row spans -->
+<!-- There should be 1 column that starts at column 2 and spans until the end. -->
+<div class="grid-container" style="
+ grid-column-gap: 16px;
+ grid-template-columns: 1fr 1fr;
+ grid-template-rows: 20px;
+ ">
+ <div class="grid-item" style="grid-column: 2 / span 5; grid-row: span 4">1</div>
+</div>
+
+<!-- Bug with column gaps - grid items should have normal height -->
+<div class="grid-container with-border" style="
+ grid-column-gap: 10px;
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
+ ">
+ <div class="grid-item with-border">left side text</div>
+ <div class="grid-item with-border">right side text right side text right side text</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/image-in-grid.html b/Tests/LibWeb/Layout/input/grid/image-in-grid.html
new file mode 100644
index 0000000000..3828deaf58
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/image-in-grid.html
@@ -0,0 +1,32 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Should render a 64px wide image -->
+<div class="grid-container" style="
+ grid-template-columns: auto 0 minmax(0, 100%);
+ ">
+ <div class="wrapper" style="width: 100%;">
+ <img style="width: 100%;" src="data:image/jpeg;base64,
+ /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDADIiJSwlHzIsKSw4NTI7S31RS0VFS5ltc1p9tZ++u7Kf
+ r6zI4f/zyNT/16yv+v/9////////wfD/////////////2wBDATU4OEtCS5NRUZP/zq/O////////
+ ////////////////////////////////////////////////////////////wAARCAAYAEADAREA
+ AhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAQMAAgQF/8QAJRABAAIBBAEEAgMAAAAAAAAAAQIR
+ AAMSITEEEyJBgTORUWFx/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAA
+ AAD/2gAMAwEAAhEDEQA/AOgM52xQDrjvAV5Xv0vfKUALlTQfeBm0HThMNHXkL0Lw/swN5qgA8yT4
+ MCS1OEOJV8mBz9Z05yfW8iSx7p4j+jA1aD6Wj7ZMzstsfvAas4UyRHvjrAkC9KhpLMClQntlqFc2
+ X1gUj4viwVObKrddH9YDoHvuujAEuNV+bLwFS8XxdSr+Cq3Vf+4F5RgQl6ZR2p1eAzU/HX80YBYy
+ JLCuexwJCO2O1bwCRidAfWBSctswbI12GAJT3yiwFR7+MBjGK2g/WAJR3FdF84E2rK5VR0YH/9k=">
+ </div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/min-max-content.html b/Tests/LibWeb/Layout/input/grid/min-max-content.html
new file mode 100644
index 0000000000..a18a8bb61a
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/min-max-content.html
@@ -0,0 +1,23 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<div class="grid-container" style="
+ grid-template-columns: min-content max-content 1fr;
+ grid-template-areas: 'one two three';
+ ">
+ <div class="grid-item" style="grid-area: one; min-width: 25%; max-width: 50%;">min-content</div>
+ <div class="grid-item" style="grid-area: two;">max-content</div>
+ <div class="grid-item" style="grid-area: three;">1fr</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/minmax.html b/Tests/LibWeb/Layout/input/grid/minmax.html
new file mode 100644
index 0000000000..c2aad80361
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/minmax.html
@@ -0,0 +1,75 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Basic minmax(): Should render 2 items side by side, each with a minimum width of 150px, If there is enough space,
+ they will expand up to 300px each. -->
+<div class="grid-container" style="grid-template-columns: minmax(150px, 300px) minmax(150px, 300px);">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+</div>
+
+<!-- Basic minmax vertical
+ Since there is no vertical limit, the two rows should be 50px high each. -->
+<div class="grid-container" style="
+ grid-template-columns: minmax(150px, 300px) minmax(150px, 300px);
+ grid-template-rows: minmax(25px, 50px) minmax(25px, 50px);
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+</div>
+
+<!-- Invalid minmax value as can't have a flexible length as a minimum value.
+ Should render 2 items with no grid formatting (one on top of the other) -->
+<div class="grid-container" style="grid-template-columns: minmax(1fr, 100px) 1fr 1fr;">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+</div>
+
+<!-- Invalid minmax value in repeat as can't have a flexible length as a minimum value
+ Should render 2 items with no grid formatting (one on top of the other) -->
+<div class="grid-container" style="grid-template-columns: repeat(3, minmax(1fr, 100px));">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+</div>
+
+<!-- Basic minmax vertical
+ Since there is a height limit, the rows should be 25px high each. -->
+<div class="grid-container" style="
+ height: 50px;
+ grid-template-columns: minmax(150px, 300px) minmax(150px, 300px);
+ grid-template-rows: minmax(25px, 50px) minmax(25px, 50px);
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+ <div class="grid-item">4</div>
+</div>
+
+<!-- Minmax horizontal with maximum as flex
+ 3 columns with minimum 200px and maximum 100%. -->
+<div class="grid-container" style="
+ grid-template-columns: minmax(200px, 1fr) minmax(200px, 1fr) minmax(200px, 1fr);
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+</div>
+
+<!-- Article layout: small margins on mobile, large on desktop. Centered column with 70ch width maximum -->
+<div class="grid-container" style="grid-template-columns: minmax(1rem, 1fr) minmax(auto, 70ch) minmax(1rem, 1fr);">
+ <div class="grid-item">1</div>
+ <div class="grid-item">Article content</div>
+ <div class="grid-item">3</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/named-tracks.html b/Tests/LibWeb/Layout/input/grid/named-tracks.html
new file mode 100644
index 0000000000..346fc043b5
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/named-tracks.html
@@ -0,0 +1,62 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Should render a 2 columned grid -->
+<div class="grid-container" style="
+ grid-template-columns:
+ [a] auto
+ [b] auto;
+ ">
+ <div class="grid-item" style="grid-column-start: a;">1</div>
+ <div class="grid-item" style="grid-column-start: b;">2</div>
+</div>
+
+<!-- Example from https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Layout_using_Named_Grid_Lines-->
+<!-- Named tracks there should be 4 grid items in a circle with a space in the middle -->
+<div class="grid-container" style="
+ grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end];
+ grid-template-rows: [main-start] 25px [content-start] 25px [content-end] 25px [main-end];
+ ">
+ <div class="grid-item" style="
+ grid-column-start: main-start;
+ grid-row-start: main-start;
+ grid-row-end: main-end;
+ ">1</div>
+ <div class="grid-item" style="
+ grid-column-start: content-end;
+ grid-row-start: main-start;
+ grid-row-end: content-end;
+ ">2</div>
+ <div class="grid-item" style="
+ grid-column-start: content-start;
+ grid-row-start: main-start;
+ ">3</div>
+ <div class="grid-item" style="
+ grid-column-start: content-start;
+ grid-column-end: main-end;
+ grid-row-start: content-end;
+ ">4</div>
+</div>
+
+<!-- Named lines inside repeat -->
+<!-- Should render 2 50px columns and 2 100px columns, with grid-item 1 starting at column 2 -->
+<div class="grid-container" style="
+ grid-template-columns: repeat(2, [name1] 50px [name2] 100px);
+ ">
+ <div class="grid-item" style="grid-column-start: name2;">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+ <div class="grid-item">4</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/positions-and-spans.html b/Tests/LibWeb/Layout/input/grid/positions-and-spans.html
new file mode 100644
index 0000000000..683fd30836
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/positions-and-spans.html
@@ -0,0 +1,67 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Column end and span -->
+<!-- There should be a column spanning 8 units, and then one spanning 4 -->
+<div class="grid-container" style="
+ grid-template-columns: repeat(12,minmax(0,5fr));
+ ">
+ <div class="grid-item" style="
+ grid-column-end: span 8;
+ ">1</div>
+ <div class="grid-item" style="
+ grid-column-end: span 4;
+ ">2</div>
+</div>
+
+<!-- Column start span takes priority over column end span -->
+<!-- There should be a column spanning 4 units, and then one spanning 8 -->
+<div class="grid-container" style="
+ grid-template-columns: repeat(12,minmax(0,5fr));
+ ">
+ <div class="grid-item" style="
+ grid-column-start: span 4;
+ grid-column-end: span 8;
+ ">1</div>
+ <div class="grid-item" style="
+ grid-column-start: span 8;
+ grid-column-end: span 4;
+ ">2</div>
+</div>
+
+<!-- Row end and span -->
+<!-- There should be a row spanning 2 units, and then one spanning 3 -->
+<div class="grid-container" style="
+ grid-template-rows: repeat(5, 20px);
+ ">
+ <div class="grid-item" style="
+ grid-row-end: span 2;
+ ">1</div>
+ <div class="grid-item" style="
+ grid-row-end: span 3;
+ ">2</div>
+</div>
+
+<!-- Grid shouldn't expand to 3 columns as having too much span doesn't change size. -->
+<!-- The bottom row should take up half the width of the grid. -->
+<div class="grid-container" style="
+ grid-template-columns: 1fr 1fr;
+ ">
+ <div class="grid-item" style="
+ grid-column: 1 / span 3;
+ grid-row: 1;
+ ">1</div>
+ <div class="grid-item">1</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/repeat.html b/Tests/LibWeb/Layout/input/grid/repeat.html
new file mode 100644
index 0000000000..16e178a933
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/repeat.html
@@ -0,0 +1,41 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Should render a full-width 4x4 grid with:
+ - one large column on the left
+ - one large column on the right, being split in half vertically, with the number 2 in the top half,
+ and numbers 3, 4, 5, and 6 in the bottom -->
+<div class="grid-container" style="
+ grid-template-columns: repeat(8, 1fr);
+ grid-template-rows: repeat(2, 25px 25px 25px 25px );
+ ">
+ <div class="grid-item" style="grid-row: 1 / -1; grid-column: span 4;">1</div>
+ <div class="grid-item" style="grid-row: 1 / 5; grid-column: 5 / -1;">2</div>
+ <div class="grid-item" style="grid-column: span 2; grid-row: span 2;">3</div>
+ <div class="grid-item" style="grid-column: span 2 / -1; grid-row: span 2;">4</div>
+ <div class="grid-item" style="grid-column: span 2; grid-row: 7 / span 100;">5</div>
+ <div class="grid-item" style="grid-column: 7 / span 2; grid-row: span 2 / -1;">6</div>
+</div>
+
+<!-- Multiple repeats -->
+<!-- Should render 2 50px columns and 2 100px columns -->
+<div class="grid-container" style="
+ grid-template-columns: repeat(2, 50px) repeat(2, 100px)
+ ">
+ <div class="grid-item">1</div>
+ <div class="grid-item">2</div>
+ <div class="grid-item">3</div>
+ <div class="grid-item">4</div>
+</div> \ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/grid/template-areas.html b/Tests/LibWeb/Layout/input/grid/template-areas.html
new file mode 100644
index 0000000000..51dd4c4224
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/template-areas.html
@@ -0,0 +1,63 @@
+<style>
+ body {
+ font-family: 'SerenitySans';
+ }
+
+ .grid-container {
+ display: grid;
+ background-color: lightsalmon;
+ }
+
+ .grid-item {
+ background-color: lightblue;
+ }
+</style>
+
+<!-- Grid template areas basics -->
+<div class="grid-container" style="
+ grid-template-columns: 1fr 1fr;
+ grid-template-areas:
+ 'left right-top'
+ 'left right-bottom';
+ ">
+ <div style="background-color: lightpink; grid-area: right-bottom / right-bottom / right-bottom / right-bottom;">
+ right-bottom</div>
+ <div style="background-color: lightgreen; grid-area: left;">left</div>
+ <div style="background-color: lightgrey; grid-column-end: right-top;">right-top</div>
+</div>
+
+<!-- Grid-lines vs. Grid template areas -->
+<!-- There should be a left-aligned column taking up 1 / 3 of the Grid -->
+<div class="grid-container" style="
+ grid-template-columns: [c] 1fr [b] 1fr [a] 1fr;
+ grid-template-areas: 'a b c';
+ ">
+ <div class="grid-item" style="grid-column-start: a; grid-column-end: a;">1fr</div>
+</div>
+
+<!-- Valid grid areas -->
+<!-- Column taking up 50% width -->
+<div class="grid-container" style="
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ grid-template-areas: 'one one three two' 'one one four two' 'one one four two';
+ ">
+ <div class="grid-item" style="grid-column-start: one; grid-column-end: one;">1fr</div>
+</div>
+
+<!-- Valid grid areas. This test should ideally fail differently FIXME -->
+<!-- Left-aligned column taking up 25% width -->
+<div class="grid-container" style="
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ grid-template-areas: 'one one three two' 'one one four one';
+ ">
+ <div class="grid-item" style="grid-column-start: two; grid-column-end: two;">1fr</div>
+</div>
+
+<!-- Valid grid areas. This test should ideally fail differently FIXME -->
+<!-- Left-aligned column taking up 25% width -->
+<div class="grid-container" style="
+ grid-template-columns: 1fr 1fr 1fr 1fr;
+ grid-template-areas: 'one one three two' 'one one four five' 'one one four two';
+ ">
+ <div class="grid-item" style="grid-column-start: two; grid-column-end: two;">1fr</div>
+</div> \ No newline at end of file