Bug 1297419 - Ensure that APZ smooth scrolls don't get clobbered by the main thread as a side-effect of reflow. r?tnikkel draft
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 06 Sep 2016 14:43:41 -0400
changeset 410383 745f39ed53029db0aa7b9845147c109f66c7f339
parent 410335 394f02edb7cb33ad70074c77b523451749c5ed0b
child 530577 7f3d338b39f8847ecc826539b2f1bad35fc9c5fc
push id28733
push userkgupta@mozilla.com
push dateTue, 06 Sep 2016 18:44:18 +0000
reviewerstnikkel
bugs1297419
milestone51.0a1
Bug 1297419 - Ensure that APZ smooth scrolls don't get clobbered by the main thread as a side-effect of reflow. r?tnikkel MozReview-Commit-ID: 9124WMy8SmD
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -5232,17 +5232,17 @@ ScrollFrameHelper::ReflowFinished()
 
   nsAutoScriptBlocker scriptBlocker;
   ScrollToRestoredPosition();
 
   // Clamp current scroll position to new bounds. Normally this won't
   // do anything.
   nsPoint currentScrollPos = GetScrollPosition();
   ScrollToImpl(currentScrollPos, nsRect(currentScrollPos, nsSize(0, 0)));
-  if (!mAsyncScroll && !mAsyncSmoothMSDScroll) {
+  if (!mAsyncScroll && !mAsyncSmoothMSDScroll && !mApzSmoothScrollDestination) {
     // We need to have mDestination track the current scroll position,
     // in case it falls outside the new reflow area. mDestination is used
     // by ScrollBy as its starting position.
     mDestination = GetScrollPosition();
   }
 
   if (!mUpdateScrollbarAttributes) {
     return false;