Tables with <caption> elements were invisible because normalize_children treated TableRowGroup/TableRow/TableCell as inline-level, causing them to be wrapped in anonymous blocks when mixed with the caption (Block). The table layout algorithm then couldn't find row groups among direct children. Three fixes: - Add table-internal types to is_block_level in normalize_children and determine_formatting_context so they aren't incorrectly wrapped - Add table-internal types to render_non_inline_descendants in the display list builder so they render when nested in inline contexts - Implement caption layout in calculate_table_layout: captions are laid out as blocks above the table rows, with rows offset accordingly - Add text-align: center to caption in UA stylesheet per CSS spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
171 lines
7.2 KiB
Plaintext
171 lines
7.2 KiB
Plaintext
LayoutBox node=#2 tag=html box=block
|
|
content: (0, 0, 800, 152.8)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#10 tag=body box=block
|
|
content: (8, 8, 784, 136.8)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 8 8 8 8
|
|
LayoutBox node=#12 tag=table box=table
|
|
content: (9, 9, 782, 134.8)
|
|
padding: 0 0 0 0
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#14 tag=thead box=table-row-group
|
|
content: (9, 11, 782, 31.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: (9, 11, 782, 31.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#18 tag=th box=table-cell
|
|
content: (17, 17, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=52.499268
|
|
line[0]: rect=(17, 17, 52.499268, 19.2) fragments=2
|
|
frag[0]: rect=(17, 17, 42.725403, 16) text="Header" start=false end=false
|
|
frag[1]: rect=(62.779736, 17, 6.71953, 16) text="1" start=false end=false
|
|
LayoutBox node=#19 tag=anonymous box=anon
|
|
content: (0, 17, 52.499268, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Header 1"
|
|
LayoutBox node=#21 tag=th box=table-cell
|
|
content: (407, 17, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=52.499268
|
|
line[0]: rect=(407, 17, 52.499268, 19.2) fragments=2
|
|
frag[0]: rect=(407, 17, 42.725403, 16) text="Header" start=false end=false
|
|
frag[1]: rect=(452.77972, 17, 6.71953, 16) text="2" start=false end=false
|
|
LayoutBox node=#22 tag=anonymous box=anon
|
|
content: (0, 17, 52.499268, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Header 2"
|
|
LayoutBox node=#26 tag=tbody box=table-row-group
|
|
content: (9, 44.2, 782, 64.40001)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#28 tag=tr box=table-row
|
|
content: (9, 44.2, 782, 31.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#30 tag=td box=table-cell
|
|
content: (17, 50.2, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=37.73275
|
|
line[0]: rect=(17, 50.2, 37.73275, 19.2) fragments=2
|
|
frag[0]: rect=(17, 50.2, 27.958883, 16) text="Body" start=false end=false
|
|
frag[1]: rect=(48.013218, 50.2, 6.71953, 16) text="1" start=false end=false
|
|
LayoutBox node=#31 tag=anonymous box=anon
|
|
content: (0, 50.2, 37.732742, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Body 1"
|
|
LayoutBox node=#33 tag=td box=table-cell
|
|
content: (407, 50.2, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=37.732758
|
|
line[0]: rect=(407, 50.2, 37.732758, 19.2) fragments=2
|
|
frag[0]: rect=(407, 50.2, 27.958883, 16) text="Body" start=false end=false
|
|
frag[1]: rect=(438.0132, 50.2, 6.71953, 16) text="2" start=false end=false
|
|
LayoutBox node=#34 tag=anonymous box=anon
|
|
content: (0, 50.2, 37.732742, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Body 2"
|
|
LayoutBox node=#37 tag=tr box=table-row
|
|
content: (9, 77.4, 782, 31.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#39 tag=td box=table-cell
|
|
content: (17, 83.4, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=37.73275
|
|
line[0]: rect=(17, 83.4, 37.73275, 19.2) fragments=2
|
|
frag[0]: rect=(17, 83.4, 27.958883, 16) text="Body" start=false end=false
|
|
frag[1]: rect=(48.013218, 83.4, 6.71953, 16) text="3" start=false end=false
|
|
LayoutBox node=#40 tag=anonymous box=anon
|
|
content: (0, 83.4, 37.732742, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Body 3"
|
|
LayoutBox node=#42 tag=td box=table-cell
|
|
content: (407, 83.4, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=37.732758
|
|
line[0]: rect=(407, 83.4, 37.732758, 19.2) fragments=2
|
|
frag[0]: rect=(407, 83.4, 27.958883, 16) text="Body" start=false end=false
|
|
frag[1]: rect=(438.0132, 83.4, 6.71953, 16) text="4" start=false end=false
|
|
LayoutBox node=#43 tag=anonymous box=anon
|
|
content: (0, 83.4, 37.732742, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Body 4"
|
|
LayoutBox node=#47 tag=tfoot box=table-row-group
|
|
content: (9, 110.600006, 782, 31.199997)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#49 tag=tr box=table-row
|
|
content: (9, 110.600006, 782, 31.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#51 tag=td box=table-cell
|
|
content: (17, 116.600006, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=45.80323
|
|
line[0]: rect=(17, 116.600006, 45.80323, 19.2) fragments=2
|
|
frag[0]: rect=(17, 116.600006, 36.029366, 16) text="Footer" start=false end=false
|
|
frag[1]: rect=(56.0837, 116.600006, 6.71953, 16) text="1" start=false end=false
|
|
LayoutBox node=#52 tag=anonymous box=anon
|
|
content: (0, 116.600006, 45.80323, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Footer 1"
|
|
LayoutBox node=#54 tag=td box=table-cell
|
|
content: (407, 116.600006, 376, 19.2)
|
|
padding: 5 5 5 5
|
|
border: 1 1 1 1
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=45.803223
|
|
line[0]: rect=(407, 116.600006, 45.803223, 19.2) fragments=2
|
|
frag[0]: rect=(407, 116.600006, 36.029366, 16) text="Footer" start=false end=false
|
|
frag[1]: rect=(446.08368, 116.600006, 6.71953, 16) text="2" start=false end=false
|
|
LayoutBox node=#55 tag=anonymous box=anon
|
|
content: (0, 116.600006, 45.80323, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Footer 2"
|