mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
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.
29 lines
385 B
HTML
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>
|