1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

LibWeb: Fix reset of floats y offset

Commit 7dc0edcb86 was supposed to prevent
floats from being placed higher than preceding boxes but the change
turned out to be completely wrong and caused regressions because:
1. Call to `clear()` in `layout_block_level_children` would reset
   floating boxes only after layout of box with _not_ inline children
although the same should happen after layout of IFC.
2. `clear()` causes offset y of floats to be reset but it also clears
   all currently enocuntered floating boxes which means the next box
   that has actual clearance will get wrong y position.
This commit is contained in:
Aliaksandr Kalenik 2023-01-26 12:48:51 +03:00 committed by Andreas Kling
parent 66f98237a7
commit 6eb2f4bfee

View file

@ -557,8 +557,6 @@ void BlockFormattingContext::layout_block_level_children(BlockContainer const& b
});
m_margin_state.block_container_y_position_update_callback = {};
m_left_floats.clear();
m_right_floats.clear();
if (layout_mode == LayoutMode::IntrinsicSizing) {
auto& block_container_state = m_state.get_mutable(block_container);