mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 15:32:51 +00:00
LibWeb: Make sure float: left
boxes get pushed down if they can't fit
This commit is contained in:
parent
52e2095a3f
commit
db545b51ef
Notes:
sideshowbarker
2024-07-17 22:55:25 +09:00
Author: https://github.com/awesomekling
Commit: db545b51ef
5 changed files with 110 additions and 9 deletions
|
@ -785,20 +785,17 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
|
|||
}
|
||||
did_touch_preceding_float = true;
|
||||
if (!fits_next_to_preceding_float)
|
||||
continue;
|
||||
break;
|
||||
offset_from_edge = tentative_offset_from_edge;
|
||||
did_place_next_to_preceding_float = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!did_touch_preceding_float) {
|
||||
// This box does not touch another floating box, go all the way to the edge.
|
||||
float_to_edge();
|
||||
|
||||
// Also, forget all previous boxes floated to this side while since they're no longer relevant.
|
||||
side_data.clear();
|
||||
} else if (!did_place_next_to_preceding_float) {
|
||||
// We ran out of horizontal space on this "float line", and need to break.
|
||||
if (!did_touch_preceding_float || !did_place_next_to_preceding_float) {
|
||||
// One of two things happened:
|
||||
// - This box does not touch another floating box.
|
||||
// - We ran out of horizontal space on this "float line", and need to break.
|
||||
// Either way, we float this box all the way to the edge.
|
||||
float_to_edge();
|
||||
CSSPixels lowest_margin_edge = 0;
|
||||
for (auto const& box : side_data.current_boxes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue