зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1546027 - Don't apply scroll anchor adjustments if we're restoring our scroll position. r=dholbert
Since scroll position restoration is absolute, and we'll lose it as soon as we apply any adjustment or do any other sort of scrolling. Differential Revision: https://phabricator.services.mozilla.com/D37941 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b44982b9f4
Коммит
1a121e2e21
|
@ -307,10 +307,14 @@ void ScrollAnchorContainer::Destroy() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollAnchorContainer::ApplyAdjustments() {
|
void ScrollAnchorContainer::ApplyAdjustments() {
|
||||||
if (!mAnchorNode || mAnchorNodeIsDirty) {
|
if (!mAnchorNode || mAnchorNodeIsDirty ||
|
||||||
|
mScrollFrame->HasPendingScrollRestoration()) {
|
||||||
mSuppressAnchorAdjustment = false;
|
mSuppressAnchorAdjustment = false;
|
||||||
ANCHOR_LOG("Ignoring post-reflow (anchor=%p, dirty=%d, container=%p).\n",
|
ANCHOR_LOG(
|
||||||
mAnchorNode, mAnchorNodeIsDirty, this);
|
"Ignoring post-reflow (anchor=%p, dirty=%d, pendingRestoration=%d, "
|
||||||
|
"container=%p).\n",
|
||||||
|
mAnchorNode, mAnchorNodeIsDirty,
|
||||||
|
mScrollFrame->HasPendingScrollRestoration(), this);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,10 @@ class ScrollFrameHelper : public nsIReflowCallback {
|
||||||
void ScrollSnap(const nsPoint& aDestination,
|
void ScrollSnap(const nsPoint& aDestination,
|
||||||
ScrollMode aMode = ScrollMode::SmoothMsd);
|
ScrollMode aMode = ScrollMode::SmoothMsd);
|
||||||
|
|
||||||
|
bool HasPendingScrollRestoration() const {
|
||||||
|
return mRestorePos != nsPoint(-1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
nsRect GetVisualScrollRange() const;
|
nsRect GetVisualScrollRange() const;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче