Files
rust_browser/tests/goldens/expected/045-mixed-headings-para.dl.txt
Zachary D. Rowitsch 20e241bd03
All checks were successful
ci / fast (linux) (push) Successful in 6m52s
Implement margin collapsing through empty elements (CSS 2.1 §8.3.1)
Self-collapsing elements (zero height, no padding/border, no BFC, no line
boxes) now have their top and bottom margins collapse together, and child
margins propagate through parents with auto height and no bottom
padding/border. This replaces the pairwise collapse_margins() function
with a MarginSet accumulator that tracks max positive and min negative
margins separately, correctly resolving chains of 4+ margins.

Key changes:
- Add is_self_collapsing() post-layout predicate and gather_all_margins()
- Add gather_margin_bottom() for bottom margin propagation with a guard
  against propagation when max-height constrains the parent
- Replace prev_margin_bottom with MarginSet-based pending_margins in the
  sibling layout loop
- Handle clearance + self-collapsing interaction correctly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 01:04:53 -05:00

15 lines
1.2 KiB
Plaintext

DisplayList items=13
Text rect=(8, 32.64, 58.525696, 32) text="Main" color=#000000 font_size=32 font_weight=700
Text rect=(72.63436, 32.64, 51.806168, 32) text="Title" color=#000000 font_size=32 font_weight=700
Text rect=(8, 90.880005, 69.75624, 16) text="Introductory" color=#000000 font_size=16
Text rect=(80.81057, 90.880005, 58.408222, 16) text="paragraph" color=#000000 font_size=16
Text rect=(142.27313, 90.880005, 33.221733, 16) text="under" color=#000000 font_size=16
Text rect=(178.54921, 90.880005, 18.126286, 16) text="the" color=#000000 font_size=16
Text rect=(199.72983, 90.880005, 24.31718, 16) text="title." color=#000000 font_size=16
Text rect=(8, 130.8, 64.70484, 24) text="Section" color=#000000 font_size=24 font_weight=700
Text rect=(77.28634, 130.8, 38.85462, 24) text="Title" color=#000000 font_size=24 font_weight=700
Text rect=(8, 178.72002, 44.15859, 16) text="Content" color=#000000 font_size=16
Text rect=(55.21292, 178.72002, 33.221733, 16) text="under" color=#000000 font_size=16
Text rect=(91.48898, 178.72002, 39.5301, 16) text="section" color=#000000 font_size=16
Text rect=(134.07343, 178.72002, 24.31718, 16) text="title." color=#000000 font_size=16