Bug 710373 - Pressing the vertical slider down arrow should move three lines instead of one. r=roc
authorJared Wein <jwein@mozilla.com>
Tue, 31 Jan 2012 12:04:35 +0100
changeset 87040 1fd0846a865f6eabf2ae0fcf449321403b6f7c8f
parent 87039 ff95d59914578e24deb8dd86ebf1670e8c750312
child 87041 5421a03367b800dcb935f946a661d0fdf7129be4
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs710373
milestone12.0a1
Bug 710373 - Pressing the vertical slider down arrow should move three lines instead of one. r=roc
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3228,27 +3228,28 @@ nsGfxScrollFrameInner::ReflowFinished()
 
   // Note, in some cases mOuter may get deleted while finishing reflow
   // for scrollbars.
   if (vScroll || hScroll) {
     nsWeakFrame weakFrame(mOuter);
     nsPoint scrollPos = GetScrollPosition();
     // XXX shouldn't we use GetPageScrollAmount/GetLineScrollAmount here?
     if (vScroll) {
-      nscoord fontHeight = GetLineScrollAmount().height;
+      const double kScrollMultiplier = 3;
+      nscoord fontHeight = GetLineScrollAmount().height * kScrollMultiplier;
       // We normally use (scrollArea.height - fontHeight) for height
       // of page scrolling.  However, it is too small when
       // fontHeight is very large. (If fontHeight is larger than
       // scrollArea.height, direction of scrolling will be opposite).
       // To avoid it, we use (float(scrollArea.height) * 0.8) as
       // lower bound value of height of page scrolling. (bug 383267)
       nscoord pageincrement = nscoord(mScrollPort.height - fontHeight);
       nscoord pageincrementMin = nscoord(float(mScrollPort.height) * 0.8);
       FinishReflowForScrollbar(vScroll, minY, maxY, scrollPos.y,
-                               NS_MAX(pageincrement,pageincrementMin),
+                               NS_MAX(pageincrement, pageincrementMin),
                                fontHeight);
     }
     if (hScroll) {
       FinishReflowForScrollbar(hScroll, minX, maxX, scrollPos.x,
                                nscoord(float(mScrollPort.width) * 0.8),
                                nsPresContext::CSSPixelsToAppUnits(10));
     }
     NS_ENSURE_TRUE(weakFrame.IsAlive(), false);