mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-23 09:22:30 +00:00
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.
3 lines
186 B
HTML
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>
|