about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-06-26 23:37:02 +0200
committerbptato <nincsnevem662@gmail.com>2024-06-27 00:00:48 +0200
commitf9734e2b3900781901bb5f268137bd9adbfc33ef (patch)
treead1cbd2b730c4504987e2d6dceecadce26c63df5 /test
parent274dffbd860f683027cbae62a6400e10687c8c35 (diff)
downloadchawan-f9734e2b3900781901bb5f268137bd9adbfc33ef.tar.gz
layout: inline fixes & improvements
* fix text-align breaking down in the presence of floats
* improve (and simplify) background color area painting

This greatly simplifies inline layout by removing the additional
text-align atom movement code and replacing it with a full re-layout
when needed. That re-layout only occurs in (rare) cases where the text
is likely to be relatively short anyway, so it's probably a win in any
remotely realistic layout.

This has also made it possible to at last merge the last three passes
(horizontal/vertical alignment and background painting) and drop that
weird synchronized tree + vector traversal.
Diffstat (limited to 'test')
-rwxr-xr-xtest/js/run_js_tests.sh1
-rw-r--r--test/layout/float-text-align-right.color.expected2
-rw-r--r--test/layout/float-text-align-right.html4
-rw-r--r--test/layout/inline_split_sizes.color.expected16
-rwxr-xr-xtest/layout/run_layout_tests.sh1
5 files changed, 16 insertions, 8 deletions
diff --git a/test/js/run_js_tests.sh b/test/js/run_js_tests.sh
index 2a3f7be8..ac531a67 100755
--- a/test/js/run_js_tests.sh
+++ b/test/js/run_js_tests.sh
@@ -10,4 +10,5 @@ do	printf '%s\r' "$h"
 		printf 'FAIL: %s\n' "$h"
 	fi
 done
+printf '\n'
 exit "$failed"
diff --git a/test/layout/float-text-align-right.color.expected b/test/layout/float-text-align-right.color.expected
new file mode 100644
index 00000000..bcb22cf8
--- /dev/null
+++ b/test/layout/float-text-align-right.color.expected
@@ -0,0 +1,2 @@
+float float float                                                      testfloat
+
diff --git a/test/layout/float-text-align-right.html b/test/layout/float-text-align-right.html
new file mode 100644
index 00000000..3c0f3c25
--- /dev/null
+++ b/test/layout/float-text-align-right.html
@@ -0,0 +1,4 @@
+<div style="text-align: right">
+<div style="float: right; background-color: red">float</div>
+<div style="float: left; background-color: red">float float float</div>
+test
diff --git a/test/layout/inline_split_sizes.color.expected b/test/layout/inline_split_sizes.color.expected
index dafbf438..636edd8a 100644
--- a/test/layout/inline_split_sizes.color.expected
+++ b/test/layout/inline_split_sizes.color.expected
@@ -1,9 +1,9 @@
-        
-before t
-
-carthago delenda
-             
-          est
-     
-hello after
+
+before t
+
+carthago delenda
+
+          est
+
+hello after
 
diff --git a/test/layout/run_layout_tests.sh b/test/layout/run_layout_tests.sh
index 2e2bfa7b..20b85ce1 100755
--- a/test/layout/run_layout_tests.sh
+++ b/test/layout/run_layout_tests.sh
@@ -20,4 +20,5 @@ do	printf '%s\r' "$h"
 	else	printf 'WARNING: expected file not found for %s\n' "$h"
 	fi
 done
+printf '\n'
 exit "$failed"