From 0e78c8114b2a43df04d75dc1decf01e06992262f Mon Sep 17 00:00:00 2001 From: Oriol Brufau Date: Thu, 14 Mar 2024 10:58:00 +0100 Subject: [PATCH] Allow finishing anonymous inline-table at the end of inline elements (#31650) This avoids inserting it outside of its parent. --- components/layout_2020/flow/construct.rs | 2 ++ .../table-anonymous-objects-213.xht.ini | 2 ++ tests/wpt/meta/MANIFEST.json | 17 +++++++++++++++++ .../table-anonymous-objects-213-ref.xht | 10 ++++++++++ .../tables/table-anonymous-objects-213.xht | 19 +++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 tests/wpt/meta-legacy-layout/css/CSS2/tables/table-anonymous-objects-213.xht.ini create mode 100644 tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213-ref.xht create mode 100644 tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213.xht diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs index 0c8982cb005..d61804751b0 100644 --- a/components/layout_2020/flow/construct.rs +++ b/components/layout_2020/flow/construct.rs @@ -487,6 +487,8 @@ where .unwrap() .traverse(self.context, info, self); + self.finish_anonymous_table_if_needed(); + let mut inline_box = self .ongoing_inline_boxes_stack .pop() diff --git a/tests/wpt/meta-legacy-layout/css/CSS2/tables/table-anonymous-objects-213.xht.ini b/tests/wpt/meta-legacy-layout/css/CSS2/tables/table-anonymous-objects-213.xht.ini new file mode 100644 index 00000000000..8052b51007d --- /dev/null +++ b/tests/wpt/meta-legacy-layout/css/CSS2/tables/table-anonymous-objects-213.xht.ini @@ -0,0 +1,2 @@ +[table-anonymous-objects-213.xht] + expected: FAIL diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index 759021b7e4c..06e2c3d496d 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -106182,6 +106182,19 @@ {} ] ], + "table-anonymous-objects-213.xht": [ + "e701a82bf063052872b94eacf7fe5b2cbd9f5b9b", + [ + null, + [ + [ + "/css/CSS2/tables/table-anonymous-objects-213-ref.xht", + "==" + ] + ], + {} + ] + ], "table-anonymous-text-indent.xht": [ "1364f79033c9b489a2c0a5eebe5e6ad2d8a89a2e", [ @@ -377992,6 +378005,10 @@ "4781f3c52702c92cedd61e79d0f9471316f7f4bd", [] ], + "table-anonymous-objects-213-ref.xht": [ + "9c2f98a29d8fc7bbd33463236a6ea02706206329", + [] + ], "table-backgrounds-bc-cell-001-ref.xht": [ "4ee2659b4458c95b53dfbd16071d4aed7b11a3b7", [] diff --git a/tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213-ref.xht b/tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213-ref.xht new file mode 100644 index 00000000000..9c2f98a29d8 --- /dev/null +++ b/tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213-ref.xht @@ -0,0 +1,10 @@ + + + + CSS Reftest Reference + + + + left right + + diff --git a/tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213.xht b/tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213.xht new file mode 100644 index 00000000000..e701a82bf06 --- /dev/null +++ b/tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213.xht @@ -0,0 +1,19 @@ + + + + CSS Test: Anonymous table objects + + + + + + + + + left + right + + +