Bug 1516056 - Adjust ScrollToRestorePosition() to reflect that the layout scroll offset is clamped to the layout viewport. r=tnikkel
authorBotond Ballo <botond@mozilla.com>
Mon, 08 Apr 2019 23:35:25 +0000
changeset 468448 946181497fb19b1293935525643dfc10a840967c
parent 468447 be6e27fbdb2cca28c50b76907407926f615b7942
child 468449 62f15d6bd36601d8a456c52cbf29eca4bebdbd1a
push id35838
push usernerli@mozilla.com
push dateTue, 09 Apr 2019 09:54:40 +0000
treeherdermozilla-central@6efaae3bcd67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1516056
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516056 - Adjust ScrollToRestorePosition() to reflect that the layout scroll offset is clamped to the layout viewport. r=tnikkel Depends on D20282 Differential Revision: https://phabricator.services.mozilla.com/D20283
layout/generic/nsGfxScrollFrame.cpp
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -4445,17 +4445,17 @@ void ScrollFrameHelper::ScrollToRestored
   // all cases
 
   // The layout offset we want to restore is the same as the visual offset
   // (for now, may change in bug 1499210), but clamped to the layout scroll
   // range (which can be a subset of the visual scroll range).
   // Note that we can't do the clamping when initializing mRestorePos in
   // RestoreState(), since the scrollable rect (which the clamping depends
   // on) can change over the course of the restoration process.
-  nsPoint layoutRestorePos = GetScrollRange().ClampPoint(mRestorePos);
+  nsPoint layoutRestorePos = GetLayoutScrollRange().ClampPoint(mRestorePos);
 
   // Continue restoring until both the layout and visual scroll positions
   // reach the destination. (Note that the two can only be different for
   // the root content document's root scroll frame, and when zoomed in).
   // This is necessary to avoid situations where the two offsets get stuck
   // at different values and nothing reconciles them (see bug 1519621 comment
   // 8).
   nsPoint logicalLayoutScrollPos = GetLogicalScrollPosition();