summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authormartinfalisse <martinmotteditfalisse@gmail.com>2023-04-01 19:09:19 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-02 19:08:04 +0200
commit6f52272d34baa4c6da2e0976a05ba71beec67eb5 (patch)
tree81817b3983b43be78bc7d9a86664cabdf93b272b /Tests
parente65f4b3dc5b6224241aa466abff308cc04b83085 (diff)
downloadserenity-6f52272d34baa4c6da2e0976a05ba71beec67eb5.zip
LibWeb: Fix regression in definite grid row heights
Fixes a row height bug when a grid item in a row has a definite height.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/grid/row-height.txt34
-rw-r--r--Tests/LibWeb/Layout/input/grid/row-height.html22
2 files changed, 56 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/grid/row-height.txt b/Tests/LibWeb/Layout/expected/grid/row-height.txt
new file mode 100644
index 0000000000..caa97fd2e4
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/row-height.txt
@@ -0,0 +1,34 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x83.46875 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x67.46875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x67.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 392.140625x50 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 392x50 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,58) 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,58 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,58) 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,58 7.75x17.46875]
+ "4"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,8) content-size 0x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/grid/row-height.html b/Tests/LibWeb/Layout/input/grid/row-height.html
new file mode 100644
index 0000000000..a1fb174fc0
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/row-height.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 with the first row having a height of 50px -->
+<div class="grid-container" style="grid-template-columns: auto auto;">
+ <div class="grid-item" style="height: 50px;">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