From 9f67b297d5436d3a1f597eb561c09d7db2d0a01a Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 25 Jan 2025 19:52:18 +0100 Subject: 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...) --- test/layout/center-in-inline.expected | 3 +++ test/layout/center-in-inline.html | 11 +++++++++++ test/layout/flex-anonymous-item-from-text.expected | 1 + test/layout/flex-anonymous-item-from-text.html | 2 ++ ...x-perc-width-constrains-intrinsic-min-width.expected | 2 +- test/layout/float-with-margins.html | 10 ++++++---- test/layout/inline-backgrounds.color.expected | 2 +- test/layout/list-item-in-inline.expected | 1 + test/layout/list-item-in-inline.html | 4 ++++ ...te-with-relative-inline-parent-offset.color.expected | 17 +++++++---------- ...ion-absolute-with-relative-inline-parent-offset.html | 10 ++++------ ...ercentage-of-indefinite-parent-height.color.expected | 2 ++ ...relative-percentage-of-indefinite-parent-height.html | 8 ++++++++ test/layout/tabs.color.expected | 2 +- .../weird-combination-of-overflow-float.color.expected | 14 ++++++++++++++ test/layout/weird-combination-of-overflow-float.html | 7 +++++++ 16 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 test/layout/center-in-inline.expected create mode 100644 test/layout/center-in-inline.html create mode 100644 test/layout/flex-anonymous-item-from-text.expected create mode 100644 test/layout/flex-anonymous-item-from-text.html create mode 100644 test/layout/list-item-in-inline.expected create mode 100644 test/layout/list-item-in-inline.html create mode 100644 test/layout/position-relative-percentage-of-indefinite-parent-height.color.expected create mode 100644 test/layout/position-relative-percentage-of-indefinite-parent-height.html create mode 100644 test/layout/weird-combination-of-overflow-float.color.expected create mode 100644 test/layout/weird-combination-of-overflow-float.html (limited to 'test') 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 @@ + +
+ +test +
+
+test +
+
+test +
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 @@ + +
[
test
]
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 @@ - - +
testing @@ -17,5 +21,3 @@ aside 3
4
- - 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 test test test test thing -final stage +final stage testing 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 @@ + + +
  • +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 2t 2t estadsfasdf test test 2 est -asdfasd fa  - - - -test +asdfasd fa   +   +   +   +test   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 @@ +

    -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 test test
    adsfasdf

    test test test test -
    +
    2t 2t 2
    asdfasd fasd
    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 +test  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 @@ + +
    +
    +test +
    +
    +test +
    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 @@ x y  ^ The above rows should be aligned, and dump mode should output spaces.  -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 @@ +red box  +  +  +  +  +  +  +  +  +  +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 @@ + +
    red box
    +
    clear
    +inline +
    overflow
    +
    +right -- cgit