diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 1e780cb8fa6..6deadc1b6e8 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -3061,15 +3061,10 @@ NS_IMETHODIMP PresShell::PageMove(PRBool aForward, PRBool aExtend) { nsresult result; - nsIViewManager* viewManager = GetViewManager(); - nsIScrollableView *scrollableView; - if (!viewManager) - return NS_ERROR_UNEXPECTED; - result = viewManager->GetRootScrollableView(&scrollableView); - if (NS_FAILED(result)) - return result; - if (!scrollableView) + nsIScrollableView *scrollableView = GetViewToScroll(nsLayoutUtils::eVertical); + if (!scrollableView) return NS_ERROR_UNEXPECTED; + nsIView *scrolledView; result = scrollableView->GetScrolledView(scrolledView); mSelection->CommonPageMove(aForward, aExtend, scrollableView); diff --git a/layout/generic/test/Makefile.in b/layout/generic/test/Makefile.in index 416834ef9f1..ea9d84a15ab 100644 --- a/layout/generic/test/Makefile.in +++ b/layout/generic/test/Makefile.in @@ -79,6 +79,7 @@ _TEST_FILES = \ $(warning test_bug421839-1.html disabled because it calls finish twice which can cause timeouts) \ test_bug421839-2.html \ bug421839-2-page.html \ + test_bug438840.html \ test_bug448860.html \ test_bug460532.html \ test_bug468167.html \ diff --git a/layout/generic/test/test_bug438840.html b/layout/generic/test/test_bug438840.html new file mode 100644 index 00000000000..457bc376de8 --- /dev/null +++ b/layout/generic/test/test_bug438840.html @@ -0,0 +1,55 @@ + + + + Test Character Movement (including nsTextFrame::PeekOffsetCharacter) + + + + + + +

+
content before the editor
+

paragraph1

+

paragraph2

+

paragraph3

+

paragraph4

+

paragraph5

+

paragraph6

+
+
content after the editor
+
+
+
+ +