LibWeb: Reuse floating box' margin box rect for clear: ...

We already store the resulting margin box rect for floating boxes
relative to their root coordinate space, so don't calculate them again.
No functional changes.
This commit is contained in:
Jelle Raaijmakers 2025-04-23 10:51:59 +02:00 committed by Andreas Kling
commit 47ed39a790
Notes: github-actions[bot] 2025-04-23 12:26:56 +00:00

View file

@ -918,10 +918,8 @@ BlockFormattingContext::DidIntroduceClearance BlockFormattingContext::clear_floa
// First, find the lowest margin box edge on this float side and calculate the Y offset just below it.
CSSPixels clearance_y_in_root = 0;
for (auto const& floating_box : float_side.current_boxes) {
auto floating_box_rect_in_root = margin_box_rect_in_ancestor_coordinate_space(floating_box.used_values, root());
clearance_y_in_root = max(clearance_y_in_root, floating_box_rect_in_root.bottom());
}
for (auto const& floating_box : float_side.current_boxes)
clearance_y_in_root = max(clearance_y_in_root, floating_box.margin_box_rect_in_root_coordinate_space.bottom());
// Then, convert the clearance Y to a coordinate relative to the containing block of `child_box`.
CSSPixels clearance_y_in_containing_block = clearance_y_in_root;