summaryrefslogtreecommitdiff
path: root/Tests/LibWeb/Layout
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-04-06 18:01:01 +0200
committerAndreas Kling <kling@serenityos.org>2023-04-07 10:15:16 +0200
commit7b4c76788b6b536cb9a30b8361d15845e081b5b3 (patch)
tree4ea18a7aff499b71b443712a1a98b401454b8297 /Tests/LibWeb/Layout
parent8760376abefc4be57d9c8aebdf9bcf281d307e15 (diff)
downloadserenity-7b4c76788b6b536cb9a30b8361d15845e081b5b3.zip
LibWeb: Don't put abspos grid/flex items in anonymous wrapper
Grid and flex containers have their own rules for abspos items, so we shouldn't try to be clever and put them in the "current" anonymous wrapper block. That behavior is primarily for the benefit of block & inline layout.
Diffstat (limited to 'Tests/LibWeb/Layout')
-rw-r--r--Tests/LibWeb/Layout/expected/flex-abspos-item-with-preceding-whitespace.txt7
-rw-r--r--Tests/LibWeb/Layout/input/flex-abspos-item-with-preceding-whitespace.html16
2 files changed, 23 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/flex-abspos-item-with-preceding-whitespace.txt b/Tests/LibWeb/Layout/expected/flex-abspos-item-with-preceding-whitespace.txt
new file mode 100644
index 0000000000..7fa013d846
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/flex-abspos-item-with-preceding-whitespace.txt
@@ -0,0 +1,7 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (1,1) content-size 798x20 children: not-inline
+ BlockContainer <body> at (10,10) content-size 780x2 children: not-inline
+ Box <div.pink> at (11,11) content-size 778x0 flex-container(row) children: not-inline
+ BlockContainer <(anonymous)> at (11,11) content-size 0x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.orange> at (11,-39) content-size 100x100 positioned children: not-inline
diff --git a/Tests/LibWeb/Layout/input/flex-abspos-item-with-preceding-whitespace.html b/Tests/LibWeb/Layout/input/flex-abspos-item-with-preceding-whitespace.html
new file mode 100644
index 0000000000..a92bd052a1
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/flex-abspos-item-with-preceding-whitespace.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html><html><head><style>
+ * {
+ border: 1px solid black !important;
+ }
+ .pink {
+ background: pink;
+ display: flex;
+ align-items: center;
+ }
+ .orange {
+ background: orange;
+ width: 100px;
+ height: 100px;
+ position: absolute;
+ }
+</style></head><body><div class="pink"> <div class="orange"> \ No newline at end of file