diff --git a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp index 9ff6e190dd..52ac009543 100644 --- a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp @@ -48,7 +48,7 @@ InlineFormattingContext::AvailableSpaceForLineInfo InlineFormattingContext::avai for (ssize_t i = bfc.left_side_floats().boxes.size() - 1; i >= 0; --i) { auto const& floating_box = bfc.left_side_floats().boxes.at(i); - auto rect = margin_box_rect(floating_box, m_state); + auto rect = margin_box_rect_in_ancestor_coordinate_space(floating_box, parent().root(), m_state); if (rect.contains_vertically(y_in_root)) { info.left = rect.right() + 1; break; @@ -59,7 +59,7 @@ InlineFormattingContext::AvailableSpaceForLineInfo InlineFormattingContext::avai for (ssize_t i = bfc.right_side_floats().boxes.size() - 1; i >= 0; --i) { auto const& floating_box = bfc.right_side_floats().boxes.at(i); - auto rect = margin_box_rect(floating_box, m_state); + auto rect = margin_box_rect_in_ancestor_coordinate_space(floating_box, parent().root(), m_state); if (rect.contains_vertically(y_in_root)) { info.right = rect.left() - 1; break;