Bug 1059242 - Initialize |allowedRange| with aPoint and a distance of zero in both directions (otherwise we'll return zero in the non-scrolled direction and reset that scroll position). r=kip
authorMats Palmgren <mats@mozilla.com>
Wed, 27 Aug 2014 11:42:00 -0400
changeset 202072 1a645efe3d6af019971862f81006ff14d4cb2a97
parent 202071 47f8093426c42688e3bab8e1cdedbb106e48e70b
child 202073 cb01380876ce809af794ab9114ac1c0335344f59
push id27390
push usercbook@mozilla.com
push dateThu, 28 Aug 2014 11:07:34 +0000
treeherdermozilla-central@2a15dc07ddaa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip
bugs1059242
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1059242 - Initialize |allowedRange| with aPoint and a distance of zero in both directions (otherwise we'll return zero in the non-scrolled direction and reset that scroll position). r=kip
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1043,17 +1043,17 @@ ScrollFrameHelper::WantAsyncScroll() con
   bool isVAsyncScrollable = isVScrollable && (mVScrollbarBox || isFocused);
   bool isHAsyncScrollable = isHScrollable && (mHScrollbarBox || isFocused);
   return isVAsyncScrollable || isHAsyncScrollable;
 }
 
 static nsRect
 GetOnePixelRangeAroundPoint(nsPoint aPoint, bool aIsHorizontal)
 {
-  nsRect allowedRange;
+  nsRect allowedRange(aPoint, nsSize());
   nscoord halfPixel = nsPresContext::CSSPixelsToAppUnits(0.5f);
   if (aIsHorizontal) {
     allowedRange.x = aPoint.x - halfPixel;
     allowedRange.width = halfPixel*2 - 1;
   } else {
     allowedRange.y = aPoint.y - halfPixel;
     allowedRange.height = halfPixel*2 - 1;
   }