summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-05-10 23:46:33 +0300
committerAndreas Kling <kling@serenityos.org>2023-05-11 18:36:56 +0200
commitc2f6ba8f5f13a49b1946aff1beca8abdc77724db (patch)
tree3a29b7ea161700d2b9ffbf298deac141b461e242 /Tests
parent7fee05e18c75d59a71f4c0c6af8f286e7759e64d (diff)
downloadserenity-c2f6ba8f5f13a49b1946aff1beca8abdc77724db.zip
LibWeb: Parse calc() function in grid sizes
Adds missing part of grid size parsing function to handle calc().
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/grid/calc-track-size.txt11
-rw-r--r--Tests/LibWeb/Layout/input/grid/calc-track-size.html12
2 files changed, 23 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/grid/calc-track-size.txt b/Tests/LibWeb/Layout/expected/grid/calc-track-size.txt
new file mode 100644
index 0000000000..195628c8fe
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/grid/calc-track-size.txt
@@ -0,0 +1,11 @@
+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 784x17.46875 children: not-inline
+ Box <div.grid-container> at (8,8) content-size 784x17.46875 [GFC] children: not-inline
+ BlockContainer <div.grid-item> at (8,8) content-size 200x17.46875 [BFC] children: inline
+ line 0 width: 31.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 3, rect: [8,8 31.265625x17.46875]
+ "Uno"
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,25.46875) content-size 784x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/grid/calc-track-size.html b/Tests/LibWeb/Layout/input/grid/calc-track-size.html
new file mode 100644
index 0000000000..f6bfe4112e
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/calc-track-size.html
@@ -0,0 +1,12 @@
+<style>
+.grid-container {
+ display: grid;
+ grid-template-columns: calc(200px);
+ grid-template-rows: auto;
+}
+
+.grid-item {
+ background-color: lightskyblue;
+}
+</style>
+<div class="grid-container"><div class="grid-item">Uno</div></div>