Files
rust_browser/tests/goldens/expected/158-table-with-caption.layout.txt
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

146 lines
6.3 KiB
Plaintext

LayoutBox node=#2 tag=html box=block
content: (0, 0, 800, 100.8)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#8 tag=body box=block
content: (8, 8, 784, 84.8)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#10 tag=table box=table
content: (8, 8, 110.998535, 84.8)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#12 tag=caption box=table-caption
content: (8, 8, 110.998535, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=68.95741
line[0]: rect=(29.020561, 8, 68.95741, 19.2) fragments=2
frag[0]: rect=(29.020561, 9.6, 23.024963, 16) text="Test" start=false end=false
frag[1]: rect=(55.099857, 9.6, 42.87812, 16) text="Caption" start=false end=false
LayoutBox node=#13 tag=anonymous box=anon
content: (0, 0, 68.95742, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Test Caption"
LayoutBox node=#15 tag=thead box=table-row-group
content: (8, 29.2, 110.998535, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#16 tag=tr box=table-row
content: (8, 29.2, 110.998535, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#17 tag=th box=table-cell
content: (10, 29.2, 52.499268, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=52.499268
line[0]: rect=(10, 29.2, 52.499268, 19.2) fragments=2
frag[0]: rect=(10, 29.2, 42.725403, 16) text="Header" start=false end=false
frag[1]: rect=(55.779736, 29.2, 6.71953, 16) text="1" start=false end=false
LayoutBox node=#18 tag=anonymous box=anon
content: (0, 29.2, 52.499268, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Header 1"
LayoutBox node=#19 tag=th box=table-cell
content: (64.49927, 29.2, 52.499268, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=52.49926
line[0]: rect=(64.49927, 29.2, 52.49926, 19.2) fragments=2
frag[0]: rect=(64.49927, 29.2, 42.725403, 16) text="Header" start=false end=false
frag[1]: rect=(110.279, 29.2, 6.71953, 16) text="2" start=false end=false
LayoutBox node=#20 tag=anonymous box=anon
content: (0, 29.2, 52.499268, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Header 2"
LayoutBox node=#22 tag=tbody box=table-row-group
content: (8, 50.4, 110.998535, 40.4)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#24 tag=tr box=table-row
content: (8, 50.4, 110.998535, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#25 tag=td box=table-cell
content: (10, 50.4, 52.499268, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=30.672543
line[0]: rect=(10, 50.4, 30.672543, 19.2) fragments=2
frag[0]: rect=(10, 50.4, 20.111603, 16) text="Cell" start=false end=false
frag[1]: rect=(33.165936, 50.4, 7.506608, 16) text="A" start=false end=false
LayoutBox node=#26 tag=anonymous box=anon
content: (0, 50.4, 30.672543, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Cell A"
LayoutBox node=#27 tag=td box=table-cell
content: (64.49927, 50.4, 52.499268, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=30.801758
line[0]: rect=(64.49927, 50.4, 30.801758, 19.2) fragments=2
frag[0]: rect=(64.49927, 50.4, 20.111603, 16) text="Cell" start=false end=false
frag[1]: rect=(87.6652, 50.4, 7.6358294, 16) text="B" start=false end=false
LayoutBox node=#28 tag=anonymous box=anon
content: (0, 50.4, 30.801765, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Cell B"
LayoutBox node=#30 tag=tr box=table-row
content: (8, 71.600006, 110.998535, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#31 tag=td box=table-cell
content: (10, 71.600006, 52.499268, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=30.590313
line[0]: rect=(10, 71.600006, 30.590313, 19.2) fragments=2
frag[0]: rect=(10, 71.600006, 20.111603, 16) text="Cell" start=false end=false
frag[1]: rect=(33.165936, 71.600006, 7.424376, 16) text="C" start=false end=false
LayoutBox node=#32 tag=anonymous box=anon
content: (0, 71.600006, 30.590311, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Cell C"
LayoutBox node=#33 tag=td box=table-cell
content: (64.49927, 71.600006, 52.499268, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
inline_context: 1 lines, height=19.2, max_width=31.741554
line[0]: rect=(64.49927, 71.600006, 31.741554, 19.2) fragments=2
frag[0]: rect=(64.49927, 71.600006, 20.111603, 16) text="Cell" start=false end=false
frag[1]: rect=(87.6652, 71.600006, 8.5756235, 16) text="D" start=false end=false
LayoutBox node=#34 tag=anonymous box=anon
content: (0, 71.600006, 31.741558, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Cell D"