Bug 1104356 - When doing a smooth scroll on a non-APZ'd scrollframe, fall back to the main thread machinery. r?kip draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 05 Feb 2016 09:06:37 -0500
changeset 329171 25e2492fb7abe09aedd240c37ae5e08b5b952442
parent 329145 1dbe350b57b17ec1ce2887441b79c6f51b429378
child 329172 a4e732df4aeebdcf7914b7ec33d4cba4cb8c577c
push id10478
push userkgupta@mozilla.com
push dateFri, 05 Feb 2016 14:06:58 +0000
reviewerskip
bugs1104356
milestone47.0a1
Bug 1104356 - When doing a smooth scroll on a non-APZ'd scrollframe, fall back to the main thread machinery. r?kip
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -2147,17 +2147,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.