Files
rust_browser/tests/goldens/fixtures/187-table-anonymous-objects.html
Zachary D. Rowitsch 0eaa317d6b Implement CSS 2.1 §17.2.1 anonymous table object generation
Add proper anonymous table object wrapping so non-proper children of a
table (anything other than TableRow, TableRowGroup, TableCaption) are
wrapped in anonymous rows, and non-cell children of rows are wrapped in
anonymous cells. This fixes the ACID2 pattern where a display:table
element with mixed table-cell, table, and block children should produce
one row with four cells.

Key changes:
- Add BoxType::TableCaption variant (previously mapped to Block)
- Rewrite normalize_table_children() to wrap all non-proper children
- Add wrap_non_cells_in_anonymous_cells() for row child normalization
- Add normalize_all_row_children() wired into both border models
- Add TableCaption to establishes_bfc() per CSS 2.1 §17.1.1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 05:06:28 -05:00

45 lines
753 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
ul {
display: table;
width: 400px;
border: 1px solid black;
list-style: none;
margin: 0;
padding: 0;
}
.cell {
display: table-cell;
width: 100px;
height: 40px;
border: 1px solid gray;
padding: 5px;
}
.inner-table {
display: table;
width: 100px;
height: 40px;
border: 1px solid blue;
}
.block {
display: block;
width: 100px;
height: 40px;
border: 1px solid green;
}
</style>
</head>
<body>
<!-- ACID2-inspired pattern: table with mixed children -->
<!-- All four children should end up in one row with four cells -->
<ul>
<li class="cell">Cell 1</li>
<li class="inner-table">Table 2</li>
<li class="cell">Cell 3</li>
<li class="block">Block 4</li>
</ul>
</body>
</html>