Bug 1543485 - Back out the hacky fix for bug 1549625. r=kats

Now that main thread scroll updates preserve the relative scroll offset
in APZ, this hacky fix is no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D87687
This commit is contained in:
Botond Ballo 2020-08-20 23:30:13 +00:00
Родитель 1ec395bfba
Коммит 27cd351633
1 изменённых файлов: 1 добавлений и 19 удалений

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

@ -2926,23 +2926,6 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
FrameLayerBuilder::GetPaintedLayerScaleForFrame(mScrolledFrame);
nsPoint curPos = GetScrollPosition();
// Below, we clamp |aPt| to the layout scroll range, compare the clamped
// value with the current scroll position, and early exit if they are the
// same. The early exit bypasses the update of |mLastScrollOrigin|, which
// is important to avoid sending a main-thread layout scroll update to APZ,
// which can clobber the visual scroll offset as well.
// If the layout viewport has shrunk in size since the last scroll, the
// 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 (StaticPrefs::apz_allow_zooming() && aPt == curPos) {
suppressScrollOriginChange = true;
}
nsPoint alignWithPos = mScrollPosForLayerPixelAlignment == nsPoint(-1, -1)
? curPos
: mScrollPosForLayerPixelAlignment;
@ -3026,8 +3009,7 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
// legitimate scroll offset updates because the origin has been masked by
// a later change within the same refresh driver tick.
allowScrollOriginChange =
(mAllowScrollOriginDowngrade || !isScrollOriginDowngrade) &&
!suppressScrollOriginChange;
(mAllowScrollOriginDowngrade || !isScrollOriginDowngrade);
if (allowScrollOriginChange) {
mLastScrollOrigin = aOrigin;