summaryrefslogtreecommitdiff
path: root/Tests/LibWeb
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-02-10 17:31:11 +0300
committerAndreas Kling <kling@serenityos.org>2023-02-10 20:55:33 +0100
commit2ed54157501973f16bcfc08720a3cffcc7cea158 (patch)
tree0af2cea11c25499443b88a24fccd987f17bd0c71 /Tests/LibWeb
parent0cd63f851e0624eb0cce151ddd34821c81123401 (diff)
downloadserenity-2ed54157501973f16bcfc08720a3cffcc7cea158.zip
LibWeb: Fix clearance to update y offset within current block
If a box has clearance and margin bottom of preceding box is greater than static y of the box then it should also affect y offset in current block container so subsequent boxes will get correct y position too.
Diffstat (limited to 'Tests/LibWeb')
-rw-r--r--Tests/LibWeb/Layout/expected/clearfix.txt16
-rw-r--r--Tests/LibWeb/Layout/input/clearfix.html23
2 files changed, 39 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/clearfix.txt b/Tests/LibWeb/Layout/expected/clearfix.txt
new file mode 100644
index 0000000000..4d286f46ad
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/clearfix.txt
@@ -0,0 +1,16 @@
+InitialContainingBlock <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x157 children: not-inline
+ BlockContainer <body> at (8,8) content-size 784x100 children: not-inline
+ BlockContainer <div> at (8,8) content-size 784x100 children: not-inline
+ BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.square.white> at (8,8) content-size 100x100 floating children: not-inline
+ TextNode <#text>
+ BlockContainer <div.clearfix> at (8,108) content-size 784x0 children: not-inline
+ BlockContainer <(anonymous)> at (8,108) content-size 784x0 children: inline
+ TextNode <#text>
+ BlockContainer <div.square.black> at (8,108) content-size 49x49 floating children: not-inline
+ BlockContainer <(anonymous)> at (8,108) content-size 784x0 children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> at (8,108) content-size 784x0 children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/clearfix.html b/Tests/LibWeb/Layout/input/clearfix.html
new file mode 100644
index 0000000000..b15946a979
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/clearfix.html
@@ -0,0 +1,23 @@
+<style>
+ .clearfix {
+ clear: both;
+ }
+ .square {
+ float: left;
+ width: 49px;
+ height: 49px;
+ }
+ .white {
+ background-color: salmon;
+ width: 100px;
+ height: 100px;
+ }
+ .black {
+ background-color: slateblue;
+ }
+</style>
+<div>
+ <div class="square white"></div>
+ <div class="clearfix"></div>
+ <div class="square black"></div>
+</div>