diff options
author | bptato <nincsnevem662@gmail.com> | 2025-01-25 19:52:18 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2025-01-25 23:36:31 +0100 |
commit | 9f67b297d5436d3a1f597eb561c09d7db2d0a01a (patch) | |
tree | 64b07e5d9ff38b9a6bd6438156a7b0c20fe46c98 /test | |
parent | f3157ce10a01e0bfa71803547b5dc8fe4d5425df (diff) | |
download | chawan-9f67b297d5436d3a1f597eb561c09d7db2d0a01a.tar.gz |
layout: do not generate anonymous inline boxes
Anonymous inline boxes were blocking progress on layout caching, so they are now gone. Instead, we handle them in layoutInline (which meanwhile has spaghettified to beyond comprehension... now it's a special case of inner BlockBox (kind of?) - incredibly, it still passes tests :P) This seems to match what major browsers do as well; some test cases were updated to reflect the "improved" rendering this brings. Next I'd like to remove anonymous table boxes by generating them in cascade. Then it should be straightforward enough to at least reuse flow roots on relayout. (And clean up flow layout...)
Diffstat (limited to 'test')
16 files changed, 73 insertions, 23 deletions
diff --git a/test/layout/center-in-inline.expected b/test/layout/center-in-inline.expected new file mode 100644 index 00000000..cb132683 --- /dev/null +++ b/test/layout/center-in-inline.expected @@ -0,0 +1,3 @@ + test + test + test diff --git a/test/layout/center-in-inline.html b/test/layout/center-in-inline.html new file mode 100644 index 00000000..bac61fd1 --- /dev/null +++ b/test/layout/center-in-inline.html @@ -0,0 +1,11 @@ +<!DOCTYPE html> +<center> +<span> +test +<center style="width: 20ch"> +<div style="width: 5ch"> +test +</div> +</center> +test +</span> diff --git a/test/layout/flex-anonymous-item-from-text.expected b/test/layout/flex-anonymous-item-from-text.expected new file mode 100644 index 00000000..b64aea45 --- /dev/null +++ b/test/layout/flex-anonymous-item-from-text.expected @@ -0,0 +1 @@ +[test] diff --git a/test/layout/flex-anonymous-item-from-text.html b/test/layout/flex-anonymous-item-from-text.html new file mode 100644 index 00000000..adbf3abc --- /dev/null +++ b/test/layout/flex-anonymous-item-from-text.html @@ -0,0 +1,2 @@ +<!DOCTYPE html> +<div style="display: flex">[<div>test</div>]</div> diff --git a/test/layout/flex-perc-width-constrains-intrinsic-min-width.expected b/test/layout/flex-perc-width-constrains-intrinsic-min-width.expected index 15bc70e4..159d7848 100644 --- a/test/layout/flex-perc-width-constrains-intrinsic-min-width.expected +++ b/test/layout/flex-perc-width-constrains-intrinsic-min-width.expected @@ -1,6 +1,6 @@ testtest testtest testtest - test + test test test test test diff --git a/test/layout/float-with-margins.html b/test/layout/float-with-margins.html index 864a4e2b..09206e51 100644 --- a/test/layout/float-with-margins.html +++ b/test/layout/float-with-margins.html @@ -1,6 +1,10 @@ <!DOCTYPE html> -<html> -<body> +<style> +* { +font-family: monospace; +font-size: 16px +} +</style> <div style="width: 20ch"> <div style="float: left; width: 20ch"> testing @@ -17,5 +21,3 @@ aside 3<br> 4 </div> -</body> -</html> diff --git a/test/layout/inline-backgrounds.color.expected b/test/layout/inline-backgrounds.color.expected index 3f140fda..52e82d6d 100644 --- a/test/layout/inline-backgrounds.color.expected +++ b/test/layout/inline-backgrounds.color.expected @@ -16,7 +16,7 @@ but [48;2;255;0;0mtest test test test thing[49m -final stage +final stage [48;2;255;0;0mtesting[49m diff --git a/test/layout/list-item-in-inline.expected b/test/layout/list-item-in-inline.expected new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/test/layout/list-item-in-inline.expected @@ -0,0 +1 @@ +test diff --git a/test/layout/list-item-in-inline.html b/test/layout/list-item-in-inline.html new file mode 100644 index 00000000..456e9ec3 --- /dev/null +++ b/test/layout/list-item-in-inline.html @@ -0,0 +1,4 @@ +<!DOCTYPE html> +<span> +<li> +test diff --git a/test/layout/position-absolute-with-relative-inline-parent-offset.color.expected b/test/layout/position-absolute-with-relative-inline-parent-offset.color.expected index 4ee85fbd..fd207776 100644 --- a/test/layout/position-absolute-with-relative-inline-parent-offset.color.expected +++ b/test/layout/position-absolute-with-relative-inline-parent-offset.color.expected @@ -1,16 +1,13 @@ -Note: the absolute box is sized differently than boxes in other engines, because -the CSS standard explicitly specifies this as UB and I *really* don't want to -make this even more complex. - -I don't care, but feel free to fix it ;) +Note: per CSS, the absolute box's sizing is explicitly UB, apparently to +accomodate for Gecko's broken rendering. We follow Blink. test test [48;2;255;0;0m2t 2t [49mestadsfasdf test test [48;2;255;0;0m2 [49mest -asdfasd fa[48;2;255;0;0m [49m - - - -test +[48;2;0;0;255masdfasd fa[48;2;255;0;0m [48;2;0;0;255m [49m + [48;2;255;0;0m [49m + [48;2;255;0;0m [49m + [48;2;255;0;0m [49m +test [48;2;255;0;0m [49m diff --git a/test/layout/position-absolute-with-relative-inline-parent-offset.html b/test/layout/position-absolute-with-relative-inline-parent-offset.html index ccebeb55..88f5882f 100644 --- a/test/layout/position-absolute-with-relative-inline-parent-offset.html +++ b/test/layout/position-absolute-with-relative-inline-parent-offset.html @@ -1,15 +1,13 @@ +<!DOCTYPE html> <!-- don't ask --> <p> -Note: the absolute box is sized differently than boxes in other engines, -because the CSS standard explicitly specifies this as UB and I *really* -don't want to make this even more complex. -<p> -I don't care, but feel free to fix it ;) +Note: per CSS, the absolute box's sizing is explicitly UB, apparently to +accomodate for Gecko's broken rendering. We follow Blink. </p> <br> <br>test test <span style="position:relative">test test<div style="display: inline-block">adsfasdf</div><BR> test test test test -<div> +<div style="background: blue"> <div style="display: block; position: absolute; top: 0em; left: 0; height: 100%; background: red; width: 3em">2t 2t 2</div> asdfasd fasd </div> diff --git a/test/layout/position-relative-percentage-of-indefinite-parent-height.color.expected b/test/layout/position-relative-percentage-of-indefinite-parent-height.color.expected new file mode 100644 index 00000000..7d66a428 --- /dev/null +++ b/test/layout/position-relative-percentage-of-indefinite-parent-height.color.expected @@ -0,0 +1,2 @@ +test +[48;2;255;0;0mtest [49m diff --git a/test/layout/position-relative-percentage-of-indefinite-parent-height.html b/test/layout/position-relative-percentage-of-indefinite-parent-height.html new file mode 100644 index 00000000..63be4367 --- /dev/null +++ b/test/layout/position-relative-percentage-of-indefinite-parent-height.html @@ -0,0 +1,8 @@ +<!DOCTYPE html> +<div> +<div> +test +</div> +<div style="position: relative; top: 300%; background: red"> +test +</div> diff --git a/test/layout/tabs.color.expected b/test/layout/tabs.color.expected index c0375438..accba20f 100644 --- a/test/layout/tabs.color.expected +++ b/test/layout/tabs.color.expected @@ -4,7 +4,7 @@ [48;2;255;0;0mx y [49m [48;2;255;0;0m^ The above rows should be aligned, and dump mode should output spaces. [49m -Without bgcolor: +Without bgcolor: x y x y diff --git a/test/layout/weird-combination-of-overflow-float.color.expected b/test/layout/weird-combination-of-overflow-float.color.expected new file mode 100644 index 00000000..3230c996 --- /dev/null +++ b/test/layout/weird-combination-of-overflow-float.color.expected @@ -0,0 +1,14 @@ +[48;2;255;0;0mred box [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +[48;2;255;0;0m [49m +clear +inline +overflow + right diff --git a/test/layout/weird-combination-of-overflow-float.html b/test/layout/weird-combination-of-overflow-float.html new file mode 100644 index 00000000..f9719177 --- /dev/null +++ b/test/layout/weird-combination-of-overflow-float.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<div style="height: 10em; background: red">red box</div> +<div style="clear: left">clear</div> +<span>inline</span> +<div><div style="overflow: auto">overflow</div></div> +<div style="float: right"> +right |