about summary refs log tree commit diff stats
path: root/test/layout/bfc-next-to-float.html
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-19 15:36:18 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-19 15:48:24 +0200
commit6078b9ca896007357b699f13aee7843f0c862b4a (patch)
tree9219970da142246ba4d8be2a6f721cfe1718a73e /test/layout/bfc-next-to-float.html
parent47d08bff7e4f82fb622e30eee770c74904dac93c (diff)
downloadchawan-6078b9ca896007357b699f13aee7843f0c862b4a.tar.gz
layout: fix BFC positioning in presence of floats
Previously, the following printed "2" instead of "12":

<div style=float:left>1</div><div style=display:flow-root>2</div>

This fixes the above problem in the laziest possible way: we relayout once
in the smallest possible space the BFC fits in when floats exist. See the
comment in the code for details.

As a nice bonus, this also fixes tables overlapping with floated boxes,
by pretending that they establish a BFC.
Diffstat (limited to 'test/layout/bfc-next-to-float.html')
-rw-r--r--test/layout/bfc-next-to-float.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/layout/bfc-next-to-float.html b/test/layout/bfc-next-to-float.html
new file mode 100644
index 00000000..cc03fb63
--- /dev/null
+++ b/test/layout/bfc-next-to-float.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<div style="float: left">
+first
+</div>
+<div style="display: flow-root">
+<div style="width: 100%">second</div> second second second second second second second second second second second second second second second
+</div>
+<div style="display: flow-root">
+third
+</div>
+<div style="float: left">
+fourth
+</div>
+<div style="display: flow-root">
+fifth
+</div>