Files
rust_browser/tests/goldens/expected/040-multiple-anchors.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

67 lines
2.5 KiB
Plaintext

LayoutBox node=#1 tag=html box=block
content: (0, 0, 800, 67.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#3 tag=body box=block
content: (8, 16, 784, 35.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#5 tag=p box=block
content: (8, 16, 784, 19.2)
padding: 0 0 0 0
border: 0 0 0 0
margin: 16 0 16 0
inline_context: 1 lines, height=19.2, max_width=225.26874
line[0]: rect=(8, 16, 225.26874, 19.2) fragments=9
frag[0]: rect=(8, 17.6, 22.977974, 16) text="Visit" start=false end=false
frag[1]: rect=(34.032307, 17.6, 20.34655, 16) text="Site" start=true end=false
frag[2]: rect=(57.43319, 17.6, 23.060205, 16) text="One" start=false end=true
frag[3]: rect=(83.54772, 17.6, 21.07489, 16) text="and" start=false end=false
frag[4]: rect=(107.67694, 17.6, 20.34655, 16) text="Site" start=true end=false
frag[5]: rect=(131.07784, 17.6, 22.872246, 16) text="Two" start=false end=true
frag[6]: rect=(157.00441, 17.6, 16, 16) text="for" start=false end=false
frag[7]: rect=(176.05875, 17.6, 29.568281, 16) text="more" start=false end=false
frag[8]: rect=(208.68137, 17.6, 24.587372, 16) text="info." start=false end=false
LayoutBox node=#6 tag=anonymous box=anon
content: (0, -8, 26.032307, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Visit "
LayoutBox node=#7 tag=a box=inline
content: (0, -8, 0, 0)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#8 tag=anonymous box=anon
content: (0, -8, 46.461086, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Site One"
LayoutBox node=#9 tag=anonymous box=anon
content: (0, -8, 27.183556, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: " and "
LayoutBox node=#10 tag=a box=inline
content: (0, -8, 0, 0)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#11 tag=anonymous box=anon
content: (0, -8, 46.27313, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Site Two"
LayoutBox node=#12 tag=anonymous box=anon
content: (0, -8, 79.31864, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: " for more info."