diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 372c6a3779fc..2e43d1804825 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4154,7 +4154,7 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, rect.IntersectRect(rect, sf->GetScrollPortRect()); } rect += container->GetPosition(); - container = container->GetParent(); + container = nsLayoutUtils::GetCrossDocParentFrame(container); } while (container); return didScroll; diff --git a/layout/base/tests/test_scroll_selection_into_view.html b/layout/base/tests/test_scroll_selection_into_view.html index 031648e0896b..5c02e60478c2 100644 --- a/layout/base/tests/test_scroll_selection_into_view.html +++ b/layout/base/tests/test_scroll_selection_into_view.html @@ -30,6 +30,17 @@
+
+ +