mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-19 15:32:31 +00:00
LibWeb: Ensure floats are correctly placed under the preceding float
Previously floats would be placed next to the highest float that fitted the new float on its line. However, this violates the rule that floats should be placed under the preceding float if it does not fit next to it.
This commit is contained in:
parent
3bf7f94150
commit
09f5ce42f6
Notes:
github-actions[bot]
2025-05-23 08:59:19 +00:00
Author: https://github.com/rubenqwertyuiop 🔰
Commit: 09f5ce42f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4805
Reviewed-by: https://github.com/gmta ✅
5 changed files with 94 additions and 17 deletions
|
@ -1147,6 +1147,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer
|
|||
.margin_box_rect_in_root_coordinate_space = margin_box_rect_in_ancestor_coordinate_space(box_state, root()),
|
||||
}));
|
||||
side_data.current_boxes.append(*side_data.all_boxes.last());
|
||||
m_last_inserted_float = *side_data.all_boxes.last();
|
||||
|
||||
if (side == FloatSide::Left) {
|
||||
side_data.current_width = offset_from_edge + box_state.content_width() + box_state.margin_box_right();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue