ladybird/Tests/LibWeb/Layout/input/block-and-inline/float-initial-available-space-vs-height.html
Jelle Raaijmakers c4bb74f40b LibWeb: Fix and improve float positioning behavior
Our recent change to get rid of the "move 1px at a time" algorithm in
the float positioning logic introduced the issue that potentially
intersecting float boxes were not evaluated in order anymore. This could
result in float boxes being pushed down further than strictly necessary.

By finding the highest point we can move the floating box to and
repeating the process until we're no longer intersecting any floating
box, we also solve some edge cases like intersecting with very long
floating boxes whose edges lay outside the current box' edges.

This is by no means the most efficient solution, but it is more correct
than what we had until now.

Fixes #4110.
2025-03-27 10:56:13 +00:00

29 lines
385 B
HTML

<!DOCTYPE html>
<style>
.a {
font-size: 5px;
width: 100px;
}
.b {
background-color: blue;
height: 100px;
width: 100px;
}
.c {
background-color: yellow;
height: 300px;
width: 30px;
}
.l {
float: left;
}
.r {
float: right;
}
</style>
<div class="a">
H
<div class="b l"></div>
<div class="c l"></div>
<div class="c r"></div>
</div>