From e4106f7b64c3540508c8306b272184282968a65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 22 Feb 2020 20:08:22 +0000 Subject: [PATCH] Bug 1615955 - Suppress scroll anchoring when scroll offset is zero. r=dholbert As per https://github.com/w3c/csswg-drafts/pull/4679. Differential Revision: https://phabricator.services.mozilla.com/D63761 --HG-- extra : moz-landing-system : lando --- layout/generic/ScrollAnchorContainer.cpp | 7 +++++-- .../zero-scroll-offset.html.ini | 16 ---------------- 2 files changed, 5 insertions(+), 18 deletions(-) delete mode 100644 testing/web-platform/meta/css/css-scroll-anchoring/zero-scroll-offset.html.ini diff --git a/layout/generic/ScrollAnchorContainer.cpp b/layout/generic/ScrollAnchorContainer.cpp index a2863b7da5a8..70834fc639f8 100644 --- a/layout/generic/ScrollAnchorContainer.cpp +++ b/layout/generic/ScrollAnchorContainer.cpp @@ -382,16 +382,19 @@ void ScrollAnchorContainer::ApplyAdjustments() { mScrollFrame->HasPendingScrollRestoration() || mScrollFrame->IsProcessingScrollEvent() || mScrollFrame->IsProcessingAsyncScroll() || - mScrollFrame->mApzSmoothScrollDestination.isSome()) { + mScrollFrame->mApzSmoothScrollDestination.isSome() || + mScrollFrame->GetScrollPosition() == nsPoint()) { ANCHOR_LOG( "Ignoring post-reflow (anchor=%p, dirty=%d, disabled=%d, " "pendingRestoration=%d, scrollevent=%d, asyncScroll=%d, " - "apzSmoothDestination=%d, pendingSuppression=%d, container=%p).\n", + "apzSmoothDestination=%d, zeroScrollPos=%d pendingSuppression=%d, " + "container=%p).\n", mAnchorNode, mAnchorNodeIsDirty, mDisabled, mScrollFrame->HasPendingScrollRestoration(), mScrollFrame->IsProcessingScrollEvent(), mScrollFrame->IsProcessingAsyncScroll(), mScrollFrame->mApzSmoothScrollDestination.isSome(), + mScrollFrame->GetScrollPosition() == nsPoint(), mSuppressAnchorAdjustment, this); if (mSuppressAnchorAdjustment) { mSuppressAnchorAdjustment = false; diff --git a/testing/web-platform/meta/css/css-scroll-anchoring/zero-scroll-offset.html.ini b/testing/web-platform/meta/css/css-scroll-anchoring/zero-scroll-offset.html.ini deleted file mode 100644 index 59b09d005c99..000000000000 --- a/testing/web-platform/meta/css/css-scroll-anchoring/zero-scroll-offset.html.ini +++ /dev/null @@ -1,16 +0,0 @@ -[zero-scroll-offset.html] - [Scroll anchoring suppressed when scroll offset is zero.] - expected: - if (os == "win") and debug and not webrender and not fission and (processor == "x86"): ["PASS", "FAIL"] - if (os == "linux") and not fission and (processor == "x86_64") and debug and not webrender: ["PASS", "FAIL"] - if (os == "linux") and not fission and (processor == "x86_64") and debug and webrender: ["PASS", "FAIL"] - if (os == "linux") and not fission and (processor == "x86_64") and not debug and webrender: ["PASS", "FAIL"] - if (os == "linux") and not fission and (processor == "x86_64") and not debug and not webrender: ["PASS", "FAIL"] - if (os == "win") and debug and webrender and fission: ["PASS", "FAIL"] - if (os == "win") and not debug and not fission and webrender: FAIL - if (os == "linux") and fission and not debug and not webrender: ["PASS", "FAIL"] - if (os == "linux") and fission and debug and webrender: ["PASS", "FAIL"] - if (os == "linux") and fission and debug and not webrender: ["PASS", "FAIL"] - if (os == "win") and not debug and fission: FAIL - [FAIL, PASS] -