Bug 1568826 - Restrict the fix for bug 1549625 to cases where we have a zoomable viewport. r=tnikkel

The fix for bug 1549625 is only necessary in cases where the layout and
visual viewports can diverge (currently mobile, and later desktop zooming),
but it has caused regressions in desktop scenarios that don't involve zooming.

While we can get a proper fix in place (tracked in bug 1543485), restricting
the existing fix to zoomable configurations mitigates the regressions.

Differential Revision: https://phabricator.services.mozilla.com/D40473

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Botond Ballo 2019-08-02 20:31:57 +00:00
parent 41872c8747
commit 9bd8db2016

View File

@ -2752,8 +2752,11 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
// clamped target position can be different from the current position, so
// we don't take the early exit, but conceptually we still want to avoid
// updating |mLastScrollOrigin| and clobbering the visual scroll offset.
// We only do this if the visual and layout scroll offsets can diverge
// in the first place, because it causes various regressions (bug 1543485
// tracks a proper fix).
bool suppressScrollOriginChange = false;
if (aPt == curPos) {
if (presContext->PresShell()->GetIsViewportOverridden() && aPt == curPos) {
suppressScrollOriginChange = true;
}