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>
31 lines
1.3 KiB
Plaintext
31 lines
1.3 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=181.68575
|
|
line[0]: rect=(8, 16, 181.68575, 19.2) fragments=7
|
|
frag[0]: rect=(8, 17.6, 24.622612, 16) text="Tom" start=false end=false
|
|
frag[1]: rect=(35.676945, 17.6, 8.599119, 16) text="&" start=false end=false
|
|
frag[2]: rect=(47.330395, 17.6, 25.527166, 16) text="Jerry" start=false end=false
|
|
frag[3]: rect=(75.91189, 17.6, 40.14097, 16) text="<span>" start=false end=false
|
|
frag[4]: rect=(119.107185, 17.6, 8.599119, 16) text="&" start=false end=false
|
|
frag[5]: rect=(130.76064, 17.6, 31.400883, 16) text="literal" start=false end=false
|
|
frag[6]: rect=(165.21585, 17.6, 24.469896, 16) text="text." start=false end=false
|
|
LayoutBox node=#6 tag=anonymous box=anon
|
|
content: (0, -8, 181.68576, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "Tom & Jerry <span> &..."
|