Bug 635645. Increase the amount of scrolling performed by using the arrow keys from 1 line to 2 lines. r=roc
authorTimothy Nikkel <tnikkel@gmail.com>
Tue, 27 Sep 2011 14:05:21 -0500
changeset 77722 df54cc03245780d449f0707f1e97250fe81c4399
parent 77721 d30c779054c917d10cd3b4d918dbbae61418e4a4
child 77723 114b45a94018cb64bfd684c8ab29b25aeef16636
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersroc
bugs635645
milestone10.0a1
Bug 635645. Increase the amount of scrolling performed by using the arrow keys from 1 line to 2 lines. r=roc This improves scrolling speed and is more inline with what other browsers do.
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -2417,22 +2417,18 @@ PresShell::ScrollPage(PRBool aForward)
 }
 
 NS_IMETHODIMP
 PresShell::ScrollLine(PRBool aForward)
 {
   nsIScrollableFrame* scrollFrame =
     GetFrameToScrollAsScrollable(nsIPresShell::eVertical);
   if (scrollFrame) {
-    PRInt32 lineCount = 1;
-#ifdef MOZ_WIDGET_COCOA
-    // Emulate the Mac IE behavior of scrolling a minimum of 2 lines
-    // rather than 1.  This vastly improves scrolling speed.
-    lineCount = 2;
-#endif
+    // Scroll 2 lines at a time to improve scrolling speed.
+    PRInt32 lineCount = 2;
     scrollFrame->ScrollBy(nsIntPoint(0, aForward ? lineCount : -lineCount),
                           nsIScrollableFrame::LINES,
                           nsIScrollableFrame::SMOOTH);
       
 //NEW FOR LINES    
     // force the update to happen now, otherwise multiple scrolls can
     // occur before the update is processed. (bug #7354)