Skip to content

Commit

Permalink
Allow finishing anonymous inline-table at the end of inline elements (#…
Browse files Browse the repository at this point in the history
…31650)

This avoids inserting it outside of its parent.
  • Loading branch information
Loirooriol committed Mar 14, 2024
1 parent 871a9bf commit 0e78c81
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/layout_2020/flow/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[table-anonymous-objects-213.xht]
expected: FAIL
17 changes: 17 additions & 0 deletions tests/wpt/meta/MANIFEST.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[
Expand Down Expand Up @@ -377992,6 +378005,10 @@
"4781f3c52702c92cedd61e79d0f9471316f7f4bd",
[]
],
"table-anonymous-objects-213-ref.xht": [
"9c2f98a29d8fc7bbd33463236a6ea02706206329",
[]
],
"table-backgrounds-bc-cell-001-ref.xht": [
"4ee2659b4458c95b53dfbd16071d4aed7b11a3b7",
[]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Reftest Reference</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com"/>
</head>
<body>
<span style="border: solid; vertical-align: top">left right</span>
</body>
</html>
19 changes: 19 additions & 0 deletions tests/wpt/tests/css/CSS2/tables/table-anonymous-objects-213.xht
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Anonymous table objects</title>
<link rel="author" title="Oriol Brufau" href="mailto:obrufau@igalia.com"/>
<link rel="help" href="http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes"/>
<link rel="help" href="https://github.com/servo/servo/issues/31649"/>
<link rel="match" href="table-anonymous-objects-213-ref.xht"/>
<meta assert="The table cell is wrapped inside an anonymous inline-level table,
so the text 'right' should appear at the right of 'left',
and the border should surround both of them."/>
</head>
<body>
<span style="border: solid; vertical-align: top">
left
<span style="display: table-cell">right</span>
</span>
</body>
</html>

0 comments on commit 0e78c81

Please sign in to comment.