summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2023-05-03 17:14:15 +0200
committerAndreas Kling <kling@serenityos.org>2023-05-03 19:49:43 +0200
commit508927cae2edd890f3267da13a5d6e2642de80a9 (patch)
treeec6fa3036b57cef4cacdf035e436da2fd51e5f12 /Tests
parent610a7603a269099e821c51a0f4ecd38177a8a496 (diff)
downloadserenity-508927cae2edd890f3267da13a5d6e2642de80a9.zip
LibWeb: Take floats into account when measuring automatic width of IFC
When there are floats present inside an IFC, we must coordinate with the parent BFC to calculate the automatic width of the IFC's block box. This is because the IFC is not directly aware of floats. Only the BFC knows enough about them to account for them in automatic sizing.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWeb/Layout/expected/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.txt6
-rw-r--r--Tests/LibWeb/Layout/input/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.html15
2 files changed, 21 insertions, 0 deletions
diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.txt b/Tests/LibWeb/Layout/expected/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.txt
new file mode 100644
index 0000000000..0a4572b393
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.txt
@@ -0,0 +1,6 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer <html> at (0,0) content-size 800x0 [BFC] children: not-inline
+ BlockContainer <body> at (8,8) content-size 140x100 positioned [BFC] children: not-inline
+ BlockContainer <div.black> at (58,58) content-size 40x0 children: inline
+ BlockContainer <div.green> at (78,78) content-size 0x0 floating [BFC] children: not-inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.html b/Tests/LibWeb/Layout/input/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.html
new file mode 100644
index 0000000000..9d61d2c302
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/automatic-size-of-block-container-with-inline-children-and-nonempty-floating-child.html
@@ -0,0 +1,15 @@
+<!doctype html><style>
+ * {
+ }
+ body {
+ position: absolute;
+ }
+ .black {
+ background: magenta;
+ border: 50px solid black;
+ }
+ .green {
+ float: left;
+ border: 20px solid lime;
+ }
+</style><body><div class="black"><div class="green"></div> \ No newline at end of file