Files
rust_browser/tests/goldens/expected/043-heading-levels.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

14 lines
1.2 KiB
Plaintext

DisplayList items=12
Text rect=(8, 32.64, 98.06755, 32) text="Heading" color=#000000 font_size=32 font_weight=700
Text rect=(112.176216, 32.64, 13.43906, 32) text="1" color=#000000 font_size=32 font_weight=700
Text rect=(8, 91.68001, 73.55066, 24) text="Heading" color=#000000 font_size=24 font_weight=700
Text rect=(86.13216, 91.68001, 10.079295, 24) text="2" color=#000000 font_size=24 font_weight=700
Text rect=(8, 139.87201, 57.369514, 18.72) text="Heading" color=#000000 font_size=18.72 font_weight=700
Text rect=(68.943085, 139.87201, 7.86185, 18.72) text="3" color=#000000 font_size=18.72 font_weight=700
Text rect=(8, 183.34402, 49.033775, 16) text="Heading" color=#000000 font_size=16 font_weight=700
Text rect=(60.088108, 183.34402, 6.71953, 16) text="4" color=#000000 font_size=16 font_weight=700
Text rect=(8, 224.44962, 40.698032, 13.28) text="Heading" color=#000000 font_size=13.28 font_weight=700
Text rect=(51.233128, 224.44962, 5.57721, 13.28) text="5" color=#000000 font_size=13.28 font_weight=700
Text rect=(8, 265.1072, 32.852627, 10.72) text="Heading" color=#000000 font_size=10.72 font_weight=700
Text rect=(42.89903, 265.1072, 4.502085, 10.72) text="6" color=#000000 font_size=10.72 font_weight=700