Files
rust_browser/tests/goldens/expected/149-float-right-with-block-children.layout.txt
Zachary D. Rowitsch b9380a8a03
All checks were successful
ci / fast (linux) (push) Successful in 6m43s
Fix inline line box height inflation that broke float two-column layouts
The strut half-leading calculation in apply_vertical_align used the
effective line height (inflated by tall inline-block elements like images)
instead of the CSS computed line-height. For a line with a 76px image and
CSS line-height: 15px, the strut got half_leading = (76 - font_height)/2
≈ 30, inflating descent by ~30px. This caused floated containers to
overflow their parents, leaking through shared BFC float contexts and
displacing sibling floats.

Fixes: pass CSS computed line-height separately for strut calculation;
also pass parent font family/weight/style for accurate strut metrics.
Adds float=left/right annotations to layout tree dumps for debugging.

32 WPT tests promoted from known_fail to pass. BMOW page sidebar moves
from x=73 to x=829 (correct float:right), content from y=4375 to y=114.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 02:36:00 -04:00

98 lines
5.1 KiB
Plaintext

LayoutBox node=#1 tag=html box=block
content: (0, 0, 800, 106.96001)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
LayoutBox node=#8 tag=body box=block
content: (8, 16, 784, 70.4)
padding: 0 0 0 0
border: 0 0 0 0
margin: 8 8 8 8
LayoutBox node=#10 tag=aside box=block float=right
content: (540.8, 17, 235.20001, 96.96001)
padding: 0 15 0 15
border: 1 1 1 1
margin: 0 0 0 15
LayoutBox node=#12 tag=h4 box=block
content: (540.8, 38.28, 235.20001, 19.200003)
padding: 0 0 0 0
border: 0 0 0 0
margin: 21.28 0 21.28 0
inline_context: 1 lines, height=19.200003, max_width=87.953
line[0]: rect=(540.8, 38.28, 87.953, 19.2) fragments=4
frag[0]: rect=(540.8, 39.88, 23.823788, 16) text="This" start=false end=false
frag[1]: rect=(567.6781, 39.88, 9.409692, 16) text="is" start=false end=false
frag[2]: rect=(580.14215, 39.88, 14.672541, 16) text="an" start=false end=false
frag[3]: rect=(597.869, 39.88, 30.883995, 16) text="aside" start=false end=false
LayoutBox node=#13 tag=anonymous box=anon
content: (501.8, 8, 87.95301, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "This is an aside"
LayoutBox node=#15 tag=p box=block
content: (540.8, 78.76, 235.20001, 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=107.00734
line[0]: rect=(540.8, 78.76, 107.00734, 19.2) fragments=3
frag[0]: rect=(540.8, 80.36, 30.014685, 16) text="Aside" start=false end=false
frag[1]: rect=(573.869, 80.36, 42.372982, 16) text="content" start=false end=false
frag[2]: rect=(619.2963, 80.36, 28.511015, 16) text="here." start=false end=false
LayoutBox node=#16 tag=anonymous box=anon
content: (501.8, 8, 107.00733, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Aside content here."
LayoutBox node=#19 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=405.79138
line[0]: rect=(8, 16, 405.79138, 19.2) fragments=13
frag[0]: rect=(8, 17.6, 27.535978, 16) text="Main" start=false end=false
frag[1]: rect=(38.590313, 17.6, 42.372982, 16) text="content" start=false end=false
frag[2]: rect=(84.017624, 17.6, 22.331863, 16) text="that" start=false end=false
frag[3]: rect=(109.40382, 17.6, 29.039646, 16) text="flows" start=false end=false
frag[4]: rect=(141.4978, 17.6, 40.293686, 16) text="around" start=false end=false
frag[5]: rect=(184.84583, 17.6, 18.126286, 16) text="the" start=false end=false
frag[6]: rect=(206.02644, 17.6, 38.860497, 16) text="floated" start=false end=false
frag[7]: rect=(247.94127, 17.6, 29.098385, 16) text="aside" start=false end=false
frag[8]: rect=(280.09396, 17.6, 45.392067, 16) text="element" start=false end=false
frag[9]: rect=(328.54034, 17.6, 14.367107, 16) text="on" start=false end=false
frag[10]: rect=(345.96176, 17.6, 18.126286, 16) text="the" start=false end=false
frag[11]: rect=(367.14236, 17.6, 17.938326, 16) text="left" start=false end=false
frag[12]: rect=(388.135, 17.6, 25.656387, 16) text="side." start=false end=false
LayoutBox node=#20 tag=anonymous box=anon
content: (0, -8, 405.79138, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Main content that fl..."
LayoutBox node=#22 tag=p box=block
content: (8, 51.2, 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=389.14536
line[0]: rect=(8, 51.2, 389.14536, 19.2) fragments=10
frag[0]: rect=(8, 52.800003, 40.305435, 16) text="Second" start=false end=false
frag[1]: rect=(51.359768, 52.800003, 58.408222, 16) text="paragraph" start=false end=false
frag[2]: rect=(112.82232, 52.800003, 11.148312, 16) text="of" start=false end=false
frag[3]: rect=(127.024956, 52.800003, 27.864904, 16) text="main" start=false end=false
frag[4]: rect=(157.9442, 52.800003, 42.372982, 16) text="content" start=false end=false
frag[5]: rect=(203.37152, 52.800003, 54.049923, 16) text="continues" start=false end=false
frag[6]: rect=(260.47577, 52.800003, 40.928047, 16) text="flowing" start=false end=false
frag[7]: rect=(304.45813, 52.800003, 40.293686, 16) text="around" start=false end=false
frag[8]: rect=(347.80615, 52.800003, 18.126286, 16) text="the" start=false end=false
frag[9]: rect=(368.98676, 52.800003, 28.158588, 16) text="float." start=false end=false
LayoutBox node=#23 tag=anonymous box=anon
content: (0, 8, 389.1454, 16)
padding: 0 0 0 0
border: 0 0 0 0
margin: 0 0 0 0
text: "Second paragraph of ..."