aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-26 21:51:33 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-26 22:29:46 +0100
commite09bedbb44e45de48adc030daa240d7aa9693339 (patch)
tree116c0940990beecfec4fe55873aef875daf73516 /test
parentd1372cda89c754b0a7e83480aa7564d21fd90a37 (diff)
downloadchawan-e09bedbb44e45de48adc030daa240d7aa9693339.tar.gz
layout: various float fixes in inline contexts
* reinit line after outer block height is known * do not set wrap in finishLine preceding outer block layout * attach pending inline floats to line boxes * unify flow a bit more The last two points mean that we now (mostly) handle inline floats like block floats, which is great because only the latter ever worked properly. (Well, margin resolution still needs work...)
Diffstat (limited to 'test')
-rw-r--r--test/layout/float-exclusion-after-outer-block-in-inline.expected2
-rw-r--r--test/layout/float-exclusion-after-outer-block-in-inline.html11
-rw-r--r--test/layout/inline-float-before-and-after-clear.expected4
-rw-r--r--test/layout/inline-float-before-and-after-clear.html6
-rw-r--r--test/layout/inline-float-weirdness.color.expected6
-rw-r--r--test/layout/inline-float-weirdness.html34
-rw-r--r--test/layout/shrink-to-fit-inline-float-right.expected3
-rw-r--r--test/layout/shrink-to-fit-inline-float-right.html9
8 files changed, 75 insertions, 0 deletions
diff --git a/test/layout/float-exclusion-after-outer-block-in-inline.expected b/test/layout/float-exclusion-after-outer-block-in-inline.expected
new file mode 100644
index 00000000..b3ddaf21
--- /dev/null
+++ b/test/layout/float-exclusion-after-outer-block-in-inline.expected
@@ -0,0 +1,2 @@
+block
+floatinline 1 inline 2
diff --git a/test/layout/float-exclusion-after-outer-block-in-inline.html b/test/layout/float-exclusion-after-outer-block-in-inline.html
new file mode 100644
index 00000000..f3f2fc7d
--- /dev/null
+++ b/test/layout/float-exclusion-after-outer-block-in-inline.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<span>
+<div>
+block
+</div>
+inline 1
+<div style="float: left">
+float
+</div>
+inline 2
+</span>
diff --git a/test/layout/inline-float-before-and-after-clear.expected b/test/layout/inline-float-before-and-after-clear.expected
new file mode 100644
index 00000000..c66997b7
--- /dev/null
+++ b/test/layout/inline-float-before-and-after-clear.expected
@@ -0,0 +1,4 @@
+leftinline
+clear
+block
+float
diff --git a/test/layout/inline-float-before-and-after-clear.html b/test/layout/inline-float-before-and-after-clear.html
new file mode 100644
index 00000000..b4e56054
--- /dev/null
+++ b/test/layout/inline-float-before-and-after-clear.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<span>inline</span>
+<div style="float: left">left</div>
+<div style="clear: both">clear</div>
+<div style="color: red">block</div>
+<div style="float: left">float</div>
diff --git a/test/layout/inline-float-weirdness.color.expected b/test/layout/inline-float-weirdness.color.expected
new file mode 100644
index 00000000..bed34fc1
--- /dev/null
+++ b/test/layout/inline-float-weirdness.color.expected
@@ -0,0 +1,6 @@
+test test  test test test 
+test  test  test 
+test  test  test 
+test test 
+test 
+test 
diff --git a/test/layout/inline-float-weirdness.html b/test/layout/inline-float-weirdness.html
new file mode 100644
index 00000000..fee51504
--- /dev/null
+++ b/test/layout/inline-float-weirdness.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<div style="display: inline-block; background: blue">
+test
+<div style="float: left; width: 100%; background: red">
+test
+</div>
+test<br>
+test
+</div>
+<div style="display: inline-block; background: blue">
+<div>
+test
+<div style="float: left; width: 100%; background: red">
+test
+</div>
+test<br>
+test
+</div>
+</div>
+<div style="display: inline-block; background: blue">
+<div style="float: left; width: 100%; background: red">
+test
+</div>
+test<br>
+test
+</div>
+<div style="background: blue">
+test
+<div style="float: left; width: 100%; background: red">
+test
+</div>
+test<br>
+test
+</div>
diff --git a/test/layout/shrink-to-fit-inline-float-right.expected b/test/layout/shrink-to-fit-inline-float-right.expected
new file mode 100644
index 00000000..9efea7ec
--- /dev/null
+++ b/test/layout/shrink-to-fit-inline-float-right.expected
@@ -0,0 +1,3 @@
+test right
+flush
+test test test right 2
diff --git a/test/layout/shrink-to-fit-inline-float-right.html b/test/layout/shrink-to-fit-inline-float-right.html
new file mode 100644
index 00000000..419c53e2
--- /dev/null
+++ b/test/layout/shrink-to-fit-inline-float-right.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<div style="display: inline-block">
+<span>
+test
+<div style="float: right">right</div>
+<div>flush</div>
+test test test
+<div style="float: right">right 2</div>
+</div>