End ongoing IFC when inserting anonymous block-level table (#31606)

So that the table appears after preceding inline-level contents.
Fixes #31603.
This commit is contained in:
Oriol Brufau 2024-03-13 22:03:06 +01:00 committed by GitHub
parent 525fc58ed9
commit f3a73dbed3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 0 deletions

View file

@ -317,6 +317,7 @@ where
self.current_inline_level_boxes()
.push(ArcRefCell::new(InlineLevelBox::Atomic(ifc)));
} else {
self.end_ongoing_inline_formatting_context();
let anonymous_info = self.info.new_anonymous(ifc.style().clone());
let table_block = ArcRefCell::new(BlockLevelBox::Independent(ifc));
self.block_level_boxes.push(BlockLevelJob {

View file

@ -106169,6 +106169,19 @@
{}
]
],
"table-anonymous-objects-212.xht": [
"e6bdfd5dd9bc30897c7e672493550600147487d8",
[
null,
[
[
"/css/CSS2/tables/table-anonymous-objects-212-ref.xht",
"=="
]
],
{}
]
],
"table-anonymous-text-indent.xht": [
"1364f79033c9b489a2c0a5eebe5e6ad2d8a89a2e",
[
@ -377975,6 +377988,10 @@
"5133164219b73747fb0f40fc98cb4a7bfca8b56a",
[]
],
"table-anonymous-objects-212-ref.xht": [
"4781f3c52702c92cedd61e79d0f9471316f7f4bd",
[]
],
"table-backgrounds-bc-cell-001-ref.xht": [
"4ee2659b4458c95b53dfbd16071d4aed7b11a3b7",
[]

View file

@ -0,0 +1,11 @@
<!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>
above<br />
below
</body>
</html>

View file

@ -0,0 +1,16 @@
<!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/31603"/>
<link rel="match" href="table-anonymous-objects-212-ref.xht"/>
<meta assert="The table cell is wrapped inside an anonymous block-level table,
so the text 'below' should appear below 'above'."/>
</head>
<body>
above
<span style="display: table-cell">below</span>
</body>
</html>