From 725cfc6bdadf4590f9509d4709caab1211347dc7 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Thu, 10 Apr 2025 12:42:34 +0200 Subject: [PATCH] LibWeb: Don't recalculate margin box rect for preceding floats We already stored that rect while building up the side data during floating box layout. No functional changes. --- Libraries/LibWeb/Layout/BlockFormattingContext.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index aa93dbbbfcc..7c52c6ca8f8 100644 --- a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -1089,8 +1089,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer // Walk all currently tracked floats on the side we're floating towards. // We're looking for the innermost preceding float that intersects vertically with `box`. for (auto& preceding_float : side_data.current_boxes.in_reverse()) { - auto const preceding_float_rect = margin_box_rect_in_ancestor_coordinate_space(preceding_float.used_values, root()); - if (!preceding_float_rect.contains_vertically(y_in_root)) + if (!preceding_float.margin_box_rect_in_root_coordinate_space.contains_vertically(y_in_root)) continue; // We found a preceding float that intersects vertically with the current float. // Now we need to find out if there's enough inline-axis space to stack them next to each other.