Don't overscroll during a fling unless overscrolling is enabled. (bug 1099442, r=botond)
authorDavid Anderson <danderson@mozilla.com>
Fri, 14 Nov 2014 16:19:00 -0800
changeset 240187 6b81753950778d82e9b71142f44aef23c6f234f3
parent 240186 b5fdc0c44b6c653babecfb14f2467de66eaee08a
child 240188 ca6516a8ca1d5dcb13d9bab74f4dc3ea51ea4f7d
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1099442
milestone36.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
Don't overscroll during a fling unless overscrolling is enabled. (bug 1099442, r=botond)
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -2006,17 +2006,17 @@ void AsyncPanZoomController::HandleFling
                                                    const nsRefPtr<const OverscrollHandoffChain>& aOverscrollHandoffChain) {
   APZCTreeManager* treeManagerLocal = GetApzcTreeManager();
   if (!(treeManagerLocal && treeManagerLocal->DispatchFling(this,
                                                             aVelocity,
                                                             aOverscrollHandoffChain,
                                                             true /* handoff */))) {
     // No one wanted the fling, so we "take it" ourselves by entering an
     // overscroll animation starting with the fling's velocity.
-    if (IsPannable()) {
+    if (IsPannable() && gfxPrefs::APZOverscrollEnabled()) {
       StartOverscrollAnimation(aVelocity);
     }
   }
 }
 
 void AsyncPanZoomController::HandleSmoothScrollOverscroll(const ParentLayerPoint& aVelocity) {
   // We must call BuildOverscrollHandoffChain from this deferred callback
   // function in order to avoid a deadlock when acquiring the tree lock.