mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 02:59:45 +00:00
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:
parent
8417ade552
commit
47ed39a790
Notes:
github-actions[bot]
2025-04-23 12:26:56 +00:00
Author: https://github.com/gmta
Commit: 47ed39a790
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4439
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue