diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index f28b694833..bf01a9d93c 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -642,7 +642,7 @@ void BlockFormattingContext::layout_floating_box(Box const& box, BlockContainer } if (fits_on_line) { - auto const previous_rect = border_box_rect_in_ancestor_coordinate_space(previous_box.box, root(), m_state); + auto const previous_rect = margin_box_rect_in_ancestor_coordinate_space(previous_box.box, root(), m_state); if (previous_rect.contains_vertically(y_in_root + side_data.y_offset)) { // This box touches another already floating box. Stack after others. offset_from_edge = wanted_offset_from_edge; @@ -759,7 +759,7 @@ BlockFormattingContext::SpaceUsedByFloats BlockFormattingContext::space_used_by_ auto const& floating_box = *floating_box_ptr; auto const& floating_box_state = m_state.get(floating_box.box); // NOTE: The floating box is *not* in the final horizontal position yet, but the size and vertical position is valid. - auto rect = border_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state); + auto rect = margin_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state); if (rect.contains_vertically(y)) { space_used_by_floats.left = floating_box.offset_from_edge + floating_box_state.content_width() @@ -772,7 +772,7 @@ BlockFormattingContext::SpaceUsedByFloats BlockFormattingContext::space_used_by_ auto const& floating_box = *floating_box_ptr; auto const& floating_box_state = m_state.get(floating_box.box); // NOTE: The floating box is *not* in the final horizontal position yet, but the size and vertical position is valid. - auto rect = border_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state); + auto rect = margin_box_rect_in_ancestor_coordinate_space(floating_box.box, root(), m_state); if (rect.contains_vertically(y)) { space_used_by_floats.right = floating_box.offset_from_edge + floating_box_state.margin_box_left();