Bug 1252708 - Able to scroll past the end of the page in Fennec with APZ enabled r=kats
authorRandall Barker <rbarker@mozilla.com>
Tue, 15 Mar 2016 16:42:08 -0700
changeset 289154 c7969fc23e51c269bf9cbcce200dc05e26214dc8
parent 289153 772bdc0bc0ea1131a065a0f7564e93b5d24e19f1
child 289155 9689998f67d4fe656592a5c838bb6ccc07fd5649
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1252708
milestone48.0a1
Bug 1252708 - Able to scroll past the end of the page in Fennec with APZ enabled r=kats
mobile/android/base/java/org/mozilla/gecko/gfx/DynamicToolbarAnimator.java
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/DynamicToolbarAnimator.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/DynamicToolbarAnimator.java
@@ -433,16 +433,24 @@ public class DynamicToolbarAnimator {
         mToolbarTranslation = FloatUtils.clamp(mToolbarTranslation - translation, 0, mMaxTranslation);
         mLayerViewTranslation = FloatUtils.clamp(mLayerViewTranslation - translation, 0, mMaxTranslation);
 
         if (oldToolbarTranslation == mToolbarTranslation &&
             oldLayerViewTranslation == mLayerViewTranslation) {
             return false;
         }
 
+        if (mToolbarTranslation == mMaxTranslation) {
+            Log.v(LOGTAG, "Toolbar at maximum translation, calling shiftLayerView(" + mMaxTranslation + ")");
+            shiftLayerView(mMaxTranslation);
+        } else if (mToolbarTranslation == 0) {
+            Log.v(LOGTAG, "Toolbar at minimum translation, calling shiftLayerView(0)");
+            shiftLayerView(0);
+        }
+
         fireListeners();
         mTarget.getView().requestRender();
         return true;
     }
 
     public PointF getVisibleEndOfLayerView() {
         return new PointF(mTarget.getView().getWidth(),
             mTarget.getView().getHeight() - mMaxTranslation + mLayerViewTranslation);