From d13e046349b0969dcc079d7aad7fc87693ac6673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 12 Feb 2020 18:56:43 +0000 Subject: [PATCH] Bug 1584035 - Don't apply scroll anchoring adjustments if we have an ongoing APZ smooth scroll. r=dholbert Same case as the other smooth-scrolling thingies, scroll anchoring is less prioritary (and is disturbing) in that case. Also fix the logging code (`WritingMode::DebugString` is no longer a thing). Differential Revision: https://phabricator.services.mozilla.com/D62050 --HG-- extra : moz-landing-system : lando --- layout/generic/ScrollAnchorContainer.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/layout/generic/ScrollAnchorContainer.cpp b/layout/generic/ScrollAnchorContainer.cpp index 835a3a183836d..a2863b7da5a8d 100644 --- a/layout/generic/ScrollAnchorContainer.cpp +++ b/layout/generic/ScrollAnchorContainer.cpp @@ -381,16 +381,18 @@ void ScrollAnchorContainer::ApplyAdjustments() { if (!mAnchorNode || mAnchorNodeIsDirty || mDisabled || mScrollFrame->HasPendingScrollRestoration() || mScrollFrame->IsProcessingScrollEvent() || - mScrollFrame->IsProcessingAsyncScroll()) { + mScrollFrame->IsProcessingAsyncScroll() || + mScrollFrame->mApzSmoothScrollDestination.isSome()) { ANCHOR_LOG( "Ignoring post-reflow (anchor=%p, dirty=%d, disabled=%d, " "pendingRestoration=%d, scrollevent=%d, asyncScroll=%d, " - "pendingSuppression=%d, container=%p).\n", + "apzSmoothDestination=%d, pendingSuppression=%d, container=%p).\n", mAnchorNode, mAnchorNodeIsDirty, mDisabled, mScrollFrame->HasPendingScrollRestoration(), mScrollFrame->IsProcessingScrollEvent(), - mScrollFrame->IsProcessingAsyncScroll(), mSuppressAnchorAdjustment, - this); + mScrollFrame->IsProcessingAsyncScroll(), + mScrollFrame->mApzSmoothScrollDestination.isSome(), + mSuppressAnchorAdjustment, this); if (mSuppressAnchorAdjustment) { mSuppressAnchorAdjustment = false; InvalidateAnchor(); @@ -419,7 +421,7 @@ void ScrollAnchorContainer::ApplyAdjustments() { } ANCHOR_LOG("Applying anchor adjustment of %d in %s with anchor %p.\n", - logicalAdjustment, writingMode.DebugString(), mAnchorNode); + logicalAdjustment, ToString(writingMode).c_str(), mAnchorNode); AdjustmentMade(logicalAdjustment);