From 59d891798f9fce13f557aabc981b217bad318b52 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 29 Mar 2010 14:46:59 +1300 Subject: [PATCH] Bug 548792. Let the search for a scrollable parent cross document boundaries. r=mats --- layout/base/nsPresShell.cpp | 4 +++- .../test_scroll_selection_into_view.html | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 7d7da57b62c4..006e0fd0223a 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4129,7 +4129,9 @@ PresShell::ScrollFrameRectIntoView(nsIFrame* aFrame, rect.IntersectRect(rect, sf->GetScrollPortRect()); } rect += container->GetPosition(); - container = container->GetParent(); + nsPoint extraOffset(0,0); + container = nsLayoutUtils::GetCrossDocParentFrame(container, &extraOffset); + rect += extraOffset; } 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 @@
+
+ +