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.
This commit is contained in:
Timothy Nikkel 2011-09-27 14:05:21 -05:00
parent 8df09d9afc
commit 0a399ab049

View File

@ -2422,12 +2422,8 @@ 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);