ladybird/Tests/LibWeb/Layout/input/block-and-inline/float-vertical-offset-by-preceding-float.html
Jelle Raaijmakers e8bc6e9e8e LibWeb: Set float Y offset using margin box bottom instead of height
When positioning floats against an edge, we are taking all current
relevant floats at that side into account to determine the Y offset at
which to place the new float. However, we were using the margin box
height instead of the absolute bottom position, which disregards the
current float's Y-position within the root, and we were setting the Y
offset to that height, instead of taking the new float's Y position
inside of the root into account.

The new code determines the lowest margin bottom value within the root
of the current floats, and adds the difference between that value and
the new float's Y position to the Y offset.
2025-01-28 01:12:23 +01:00

3 lines
186 B
HTML

<div style="height: 50px; width: 50px; background-color: blue; float: left"></div>
<p>A<br>B<br>C
</p><div style="height: 50px; width: 50px; background-color: green; float: left"></div>