Files
rust_browser/tests/goldens/expected/196-first-line-basic.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

49 lines
2.8 KiB
Plaintext

LayoutBox node=#2 tag=html box=block
content: (0, 0, 800, 124.8)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#10 tag=body box=block
content: (8, 16, 784, 92.8)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#12 tag=p box=block
content: (8, 16, 200, 76.8)
padding: 0 0 0 0
border: 0 0 0 0
margin: 16 0 16 0
inline_context: 4 lines, height=76.8, max_width=198.69604
line[0]: rect=(8, 16, 170.19678, 19.2) fragments=6
frag[0]: rect=(8, 17.6, 20.417034, 16) text="The" start=false end=false
frag[1]: rect=(31.471367, 17.6, 21.791481, 16) text="first" start=false end=false
frag[2]: rect=(56.31718, 17.6, 19.947138, 16) text="line" start=false end=false
frag[3]: rect=(79.31865, 17.6, 11.148312, 16) text="of" start=false end=false
frag[4]: rect=(93.52129, 17.6, 20.15859, 16) text="this" start=false end=false
frag[5]: rect=(116.734215, 17.6, 58.408222, 16) text="paragraph" start=false end=false
line[1]: rect=(8, 35.2, 190.00294, 19.2) fragments=8
frag[0]: rect=(8, 36.800003, 37.509544, 16) text="should" start=false end=false
frag[1]: rect=(48.563877, 36.800003, 13.85022, 16) text="be" start=false end=false
frag[2]: rect=(65.46843, 36.800003, 21.85022, 16) text="red." start=false end=false
frag[3]: rect=(90.37298, 36.800003, 20.417034, 16) text="The" start=false end=false
frag[4]: rect=(113.84434, 36.800003, 21.345081, 16) text="rest" start=false end=false
frag[5]: rect=(138.24376, 36.800003, 11.148312, 16) text="of" start=false end=false
frag[6]: rect=(152.44641, 36.800003, 18.126286, 16) text="the" start=false end=false
frag[7]: rect=(173.62703, 36.800003, 21.321585, 16) text="text" start=false end=false
line[2]: rect=(8, 54.4, 198.69604, 19.2) fragments=7
frag[0]: rect=(8, 56, 37.509544, 16) text="should" start=false end=false
frag[1]: rect=(48.563877, 56, 13.85022, 16) text="be" start=false end=false
frag[2]: rect=(65.46843, 56, 18.126286, 16) text="the" start=false end=false
frag[3]: rect=(86.64904, 56, 39.013214, 16) text="default" start=false end=false
frag[4]: rect=(128.71658, 56, 27.735683, 16) text="color" start=false end=false
frag[5]: rect=(159.5066, 56, 32.42291, 16) text="which" start=false end=false
frag[6]: rect=(194.98386, 56, 8.657856, 16) text="is" start=false end=false
line[3]: rect=(8, 73.600006, 31.906021, 19.2) fragments=1
frag[0]: rect=(8, 75.200005, 31.906021, 16) text="black." start=false end=false
LayoutBox node=#13 tag=anonymous box=anon
content: (0, -8, 590.8016, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "The first line of th..."