From 6eb2f4bfee1c8978444486354a8586b1e5c55676 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Thu, 26 Jan 2023 12:48:51 +0300 Subject: [PATCH] LibWeb: Fix reset of floats y offset Commit 7dc0edcb8625deae09317a1861d3c8d6ad9bca61 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. --- Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index a8613da044..620e79f980 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -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);