Bug 1104356 - When doing a smooth scroll on a non-APZ'd scrollframe, fall back to the main thread machinery. r=kip, a=lizzard
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 05 Feb 2016 17:09:30 -0500
changeset 303957 215b8f3a6f8a95b590c4f255e9c2ad79bcf754c4
parent 303956 eb1aa0960ac20757cc1cf9dff2cf0765955a3067
child 303958 a2e455d9b266cc42b205a3aa1386cddc068a9b07
push id9068
push usercbook@mozilla.com
push dateMon, 15 Feb 2016 14:13:10 +0000
treeherdermozilla-aurora@2a42ee967471 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip, lizzard
bugs1104356
milestone46.0a2
Bug 1104356 - When doing a smooth scroll on a non-APZ'd scrollframe, fall back to the main thread machinery. r=kip, a=lizzard
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2131,17 +2131,17 @@ ScrollFrameHelper::ScrollToWithOrigin(ns
         currentVelocity.height = sv.y;
         if (mAsyncScroll) {
           if (mAsyncScroll->mIsSmoothScroll) {
             currentVelocity = mAsyncScroll->VelocityAt(now);
           }
           mAsyncScroll = nullptr;
         }
 
-        if (nsLayoutUtils::AsyncPanZoomEnabled(mOuter)) {
+        if (nsLayoutUtils::AsyncPanZoomEnabled(mOuter) && WantAsyncScroll()) {
           if (mApzSmoothScrollDestination == Some(mDestination) &&
               mScrollGeneration == sScrollGenerationCounter) {
             // If we already sent APZ a smooth-scroll request to this
             // destination with this generation (i.e. it was the last request
             // we sent), then don't send another one because it is redundant.
             // This is to avoid a scenario where pages do repeated scrollBy
             // calls, incrementing the generation counter, and blocking APZ from
             // syncing the scroll offset back to the main thread.