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>
16 lines
1.2 KiB
Plaintext
16 lines
1.2 KiB
Plaintext
DisplayList items=14
|
|
Text rect=(365.5213, 8, 23.024963, 16) text="Test" color=#000000 font_size=16
|
|
Text rect=(391.6006, 8, 42.87812, 16) text="Caption" color=#000000 font_size=16
|
|
Text rect=(10, 29.2, 42.725403, 16) text="Header" color=#000000 font_size=16 font_weight=700
|
|
Text rect=(55.779736, 29.2, 6.71953, 16) text="1" color=#000000 font_size=16 font_weight=700
|
|
Text rect=(401, 29.2, 42.725403, 16) text="Header" color=#000000 font_size=16 font_weight=700
|
|
Text rect=(446.77972, 29.2, 6.71953, 16) text="2" color=#000000 font_size=16 font_weight=700
|
|
Text rect=(10, 50.4, 20.111603, 16) text="Cell" color=#000000 font_size=16
|
|
Text rect=(33.165936, 50.4, 7.506608, 16) text="A" color=#000000 font_size=16
|
|
Text rect=(401, 50.4, 20.111603, 16) text="Cell" color=#000000 font_size=16
|
|
Text rect=(424.16592, 50.4, 7.6358294, 16) text="B" color=#000000 font_size=16
|
|
Text rect=(10, 71.600006, 20.111603, 16) text="Cell" color=#000000 font_size=16
|
|
Text rect=(33.165936, 71.600006, 7.424376, 16) text="C" color=#000000 font_size=16
|
|
Text rect=(401, 71.600006, 20.111603, 16) text="Cell" color=#000000 font_size=16
|
|
Text rect=(424.16592, 71.600006, 8.5756235, 16) text="D" color=#000000 font_size=16
|