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
This commit is contained in:
Emilio Cobos Álvarez 2020-02-22 20:08:22 +00:00
Родитель 3e8d050c21
Коммит e4106f7b64
2 изменённых файлов: 5 добавлений и 18 удалений

Просмотреть файл

@ -382,16 +382,19 @@ void ScrollAnchorContainer::ApplyAdjustments() {
mScrollFrame->HasPendingScrollRestoration() || mScrollFrame->HasPendingScrollRestoration() ||
mScrollFrame->IsProcessingScrollEvent() || mScrollFrame->IsProcessingScrollEvent() ||
mScrollFrame->IsProcessingAsyncScroll() || mScrollFrame->IsProcessingAsyncScroll() ||
mScrollFrame->mApzSmoothScrollDestination.isSome()) { mScrollFrame->mApzSmoothScrollDestination.isSome() ||
mScrollFrame->GetScrollPosition() == nsPoint()) {
ANCHOR_LOG( ANCHOR_LOG(
"Ignoring post-reflow (anchor=%p, dirty=%d, disabled=%d, " "Ignoring post-reflow (anchor=%p, dirty=%d, disabled=%d, "
"pendingRestoration=%d, scrollevent=%d, asyncScroll=%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, mAnchorNode, mAnchorNodeIsDirty, mDisabled,
mScrollFrame->HasPendingScrollRestoration(), mScrollFrame->HasPendingScrollRestoration(),
mScrollFrame->IsProcessingScrollEvent(), mScrollFrame->IsProcessingScrollEvent(),
mScrollFrame->IsProcessingAsyncScroll(), mScrollFrame->IsProcessingAsyncScroll(),
mScrollFrame->mApzSmoothScrollDestination.isSome(), mScrollFrame->mApzSmoothScrollDestination.isSome(),
mScrollFrame->GetScrollPosition() == nsPoint(),
mSuppressAnchorAdjustment, this); mSuppressAnchorAdjustment, this);
if (mSuppressAnchorAdjustment) { if (mSuppressAnchorAdjustment) {
mSuppressAnchorAdjustment = false; mSuppressAnchorAdjustment = false;

Просмотреть файл

@ -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]