Files
rust_browser/tests/goldens/expected/045-mixed-headings-para.layout.txt
Zachary D. Rowitsch 0863153acd Implement parent-child margin collapsing (CSS 2.1 §8.3.1)
Add parent-first-child top and parent-last-child bottom margin collapsing
using a two-level approach (Level A shifts child inside parent, Level B
adjusts grandparent for effective collapsed margin). Fix pre-existing bug
in shift_subtree_x that incorrectly skipped absolute/fixed children.
Extract shared MARGIN_EPSILON constant, add 9 unit tests and 4 golden
tests (209-212), promote 31 WPT tests to pass. Includes code review
fixes: pub(crate) visibility for is_root_element, known-limitation docs,
and inline-content shift test coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-13 18:41:50 -04:00

76 lines
3.4 KiB
Plaintext

LayoutBox node=#1 tag=html box=block
content: (0, 0, 800, 220.32)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#3 tag=body box=block
content: (8, 21.44, 784, 182.88)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#5 tag=h1 box=block
content: (8, 21.44, 784, 38.4)
padding: 0 0 0 0
border: 0 0 0 0
margin: 21.44 0 21.44 0
inline_context: 1 lines, height=38.4, max_width=116.44053
line[0]: rect=(8, 21.44, 116.44053, 38.4) fragments=2
frag[0]: rect=(8, 24.64, 58.525696, 32) text="Main" start=false end=false
frag[1]: rect=(72.63436, 24.64, 51.806168, 32) text="Title" start=false end=false
LayoutBox node=#6 tag=anonymous box=anon
content: (0, -8, 116.44052, 32)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Main Title"
LayoutBox node=#8 tag=p box=block
content: (8, 81.28001, 784, 19.200005)
padding: 0 0 0 0
border: 0 0 0 0
margin: 16 0 16 0
inline_context: 1 lines, height=19.200005, max_width=216.04701
line[0]: rect=(8, 81.28001, 216.04701, 19.2) fragments=5
frag[0]: rect=(8, 82.880005, 69.75624, 16) text="Introductory" start=false end=false
frag[1]: rect=(80.81057, 82.880005, 58.408222, 16) text="paragraph" start=false end=false
frag[2]: rect=(142.27313, 82.880005, 33.221733, 16) text="under" start=false end=false
frag[3]: rect=(178.54921, 82.880005, 18.126286, 16) text="the" start=false end=false
frag[4]: rect=(199.72983, 82.880005, 24.31718, 16) text="title." start=false end=false
LayoutBox node=#9 tag=anonymous box=anon
content: (0, 13.440001, 216.04704, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Introductory paragra..."
LayoutBox node=#11 tag=h2 box=block
content: (8, 120.40001, 784, 28.800003)
padding: 0 0 0 0
border: 0 0 0 0
margin: 19.92 0 19.92 0
inline_context: 1 lines, height=28.800003, max_width=108.14096
line[0]: rect=(8, 120.40001, 108.14096, 28.800001) fragments=2
frag[0]: rect=(8, 122.80001, 64.70484, 24) text="Section" start=false end=false
frag[1]: rect=(77.28634, 122.80001, 38.85462, 24) text="Title" start=false end=false
LayoutBox node=#12 tag=anonymous box=anon
content: (0, 13.440001, 108.14095, 24)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Section Title"
LayoutBox node=#14 tag=p box=block
content: (8, 169.12001, 784, 19.199997)
padding: 0 0 0 0
border: 0 0 0 0
margin: 16 0 16 0
inline_context: 1 lines, height=19.199997, max_width=150.39061
line[0]: rect=(8, 169.12001, 150.39061, 19.2) fragments=4
frag[0]: rect=(8, 170.72002, 44.15859, 16) text="Content" start=false end=false
frag[1]: rect=(55.21292, 170.72002, 33.221733, 16) text="under" start=false end=false
frag[2]: rect=(91.48898, 170.72002, 39.5301, 16) text="section" start=false end=false
frag[3]: rect=(134.07343, 170.72002, 24.31718, 16) text="title." start=false end=false
LayoutBox node=#15 tag=anonymous box=anon
content: (0, 13.440001, 150.3906, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Content under sectio..."