Files
rust_browser/tests/goldens/expected/080-table-sections.dl.txt
Zachary D. Rowitsch f642f4f17c Fix tables with captions not rendering and add caption layout support
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>
2026-02-13 00:24:29 -05:00

29 lines
2.3 KiB
Plaintext

DisplayList items=27
Border rect=(8, 8, 784, 136.8) widths=(1 1 1 1) colors=(#000000 #000000 #000000 #000000)
SolidRect rect=(11, 11, 388, 31.2) color=#d3d3d3
Border rect=(11, 11, 388, 31.2) widths=(1 1 1 1) colors=(#000000 #000000 #000000 #000000)
Text rect=(17, 17, 42.725403, 16) text="Header" color=#000000 font_size=16 font_weight=700
Text rect=(62.779736, 17, 6.71953, 16) text="1" color=#000000 font_size=16 font_weight=700
SolidRect rect=(401, 11, 388, 31.2) color=#d3d3d3
Border rect=(401, 11, 388, 31.2) widths=(1 1 1 1) colors=(#000000 #000000 #000000 #000000)
Text rect=(407, 17, 42.725403, 16) text="Header" color=#000000 font_size=16 font_weight=700
Text rect=(452.77972, 17, 6.71953, 16) text="2" color=#000000 font_size=16 font_weight=700
Border rect=(11, 44.2, 388, 31.2) widths=(1 1 1 1) colors=(#808080 #808080 #808080 #808080)
Text rect=(17, 50.2, 27.958883, 16) text="Body" color=#000000 font_size=16
Text rect=(48.013218, 50.2, 6.71953, 16) text="1" color=#000000 font_size=16
Border rect=(401, 44.2, 388, 31.2) widths=(1 1 1 1) colors=(#808080 #808080 #808080 #808080)
Text rect=(407, 50.2, 27.958883, 16) text="Body" color=#000000 font_size=16
Text rect=(438.0132, 50.2, 6.71953, 16) text="2" color=#000000 font_size=16
Border rect=(11, 77.4, 388, 31.2) widths=(1 1 1 1) colors=(#808080 #808080 #808080 #808080)
Text rect=(17, 83.4, 27.958883, 16) text="Body" color=#000000 font_size=16
Text rect=(48.013218, 83.4, 6.71953, 16) text="3" color=#000000 font_size=16
Border rect=(401, 77.4, 388, 31.2) widths=(1 1 1 1) colors=(#808080 #808080 #808080 #808080)
Text rect=(407, 83.4, 27.958883, 16) text="Body" color=#000000 font_size=16
Text rect=(438.0132, 83.4, 6.71953, 16) text="4" color=#000000 font_size=16
Border rect=(11, 110.600006, 388, 31.2) widths=(1 1 1 1) colors=(#808080 #808080 #808080 #808080)
Text rect=(17, 116.600006, 36.029366, 16) text="Footer" color=#000000 font_size=16
Text rect=(56.0837, 116.600006, 6.71953, 16) text="1" color=#000000 font_size=16
Border rect=(401, 110.600006, 388, 31.2) widths=(1 1 1 1) colors=(#808080 #808080 #808080 #808080)
Text rect=(407, 116.600006, 36.029366, 16) text="Footer" color=#000000 font_size=16
Text rect=(446.08368, 116.600006, 6.71953, 16) text="2" color=#000000 font_size=16