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>
115 lines
4.5 KiB
Plaintext
115 lines
4.5 KiB
Plaintext
LayoutBox node=#2 tag=html box=block
|
|
content: (0, 0, 800, 103.600006)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#10 tag=body box=block
|
|
content: (8, 8, 784, 87.600006)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 8 8 8 8
|
|
LayoutBox node=#12 tag=table box=table
|
|
content: (8.5, 8.5, 78.395004, 86.600006)
|
|
padding: 0 0 0 0
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#14 tag=tr box=table-row
|
|
content: (8.5, 8.5, 78.395004, 28.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#15 tag=td box=table-cell
|
|
content: (13, 13, 28.170338, 19.2)
|
|
padding: 4 4 4 4
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=28.170338
|
|
line[0]: rect=(13, 13, 28.170338, 19.2) fragments=1
|
|
frag[0]: rect=(13, 13, 28.170338, 16) text="R1C1" start=false end=false
|
|
LayoutBox node=#16 tag=anonymous box=anon
|
|
content: (0, 13, 28.170338, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "R1C1"
|
|
LayoutBox node=#17 tag=td box=table-cell
|
|
content: (51.170338, 13, 31.22467, 19.2)
|
|
padding: 4 4 4 4
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=31.224667
|
|
line[0]: rect=(51.170338, 13, 31.224667, 19.2) fragments=1
|
|
frag[0]: rect=(51.170338, 13, 28.170338, 16) text="R1C2" start=false end=false
|
|
LayoutBox node=#18 tag=anonymous box=anon
|
|
content: (0, 13, 31.22467, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "R1C2 "
|
|
LayoutBox node=#19 tag=tr box=table-row
|
|
content: (8.5, 37.7, 78.395004, 28.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#20 tag=td box=table-cell
|
|
content: (13, 42.2, 28.170338, 19.2)
|
|
padding: 4 4 4 4
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=28.170338
|
|
line[0]: rect=(13, 42.2, 28.170338, 19.2) fragments=1
|
|
frag[0]: rect=(13, 42.2, 28.170338, 16) text="R2C1" start=false end=false
|
|
LayoutBox node=#21 tag=anonymous box=anon
|
|
content: (0, 42.2, 28.170338, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "R2C1"
|
|
LayoutBox node=#22 tag=td box=table-cell
|
|
content: (51.170338, 42.2, 31.22467, 19.2)
|
|
padding: 4 4 4 4
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=31.224667
|
|
line[0]: rect=(51.170338, 42.2, 31.224667, 19.2) fragments=1
|
|
frag[0]: rect=(51.170338, 42.2, 28.170338, 16) text="R2C2" start=false end=false
|
|
LayoutBox node=#23 tag=anonymous box=anon
|
|
content: (0, 42.2, 31.22467, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "R2C2 "
|
|
LayoutBox node=#24 tag=tr box=table-row
|
|
content: (8.5, 66.9, 78.395004, 28.2)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
LayoutBox node=#25 tag=td box=table-cell
|
|
content: (13, 71.4, 28.170338, 19.2)
|
|
padding: 4 4 4 4
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=28.170338
|
|
line[0]: rect=(13, 71.4, 28.170338, 19.2) fragments=1
|
|
frag[0]: rect=(13, 71.4, 28.170338, 16) text="R3C1" start=false end=false
|
|
LayoutBox node=#26 tag=anonymous box=anon
|
|
content: (0, 71.4, 28.170338, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "R3C1"
|
|
LayoutBox node=#27 tag=td box=table-cell
|
|
content: (51.170338, 71.4, 31.22467, 19.2)
|
|
padding: 4 4 4 4
|
|
border: 0.5 0.5 0.5 0.5
|
|
margin: 0 0 0 0
|
|
inline_context: 1 lines, height=19.2, max_width=31.224667
|
|
line[0]: rect=(51.170338, 71.4, 31.224667, 19.2) fragments=1
|
|
frag[0]: rect=(51.170338, 71.4, 28.170338, 16) text="R3C2" start=false end=false
|
|
LayoutBox node=#28 tag=anonymous box=anon
|
|
content: (0, 71.4, 31.22467, 16)
|
|
padding: 0 0 0 0
|
|
border: 0 0 0 0
|
|
margin: 0 0 0 0
|
|
text: "R3C2 "
|