Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1069)

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 1271143003: Fix scroll restoration clamping bug (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Notify progress tracker before trying to restore position Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/loader/scroll-position-restoration-without-premature-clamping-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index f725ad749dd143989689b2e0eb499d7fc147a6a7..f4caafb906bd602da45e43128c9c163837d24e0f 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -573,13 +573,12 @@ void FrameLoader::checkCompleted()
m_frame->view()->handleLoadCompleted();
if (shouldSendCompleteNotifications(m_frame)) {
- m_loadType = FrameLoadTypeStandard;
m_progressTracker->progressCompleted();
// Retry restoring scroll offset since finishing loading disables content
// size clamping.
- // TODO(majidvp): Remove this call as it appears to be a no-op because
- // we set load type to |FrameLoadTypeStandard| just above.
restoreScrollPositionAndViewState();
+
+ m_loadType = FrameLoadTypeStandard;
m_frame->localDOMWindow()->finishedLoading();
// Report mobile vs. desktop page statistics. This will only report on Android.
@@ -1134,7 +1133,7 @@ void FrameLoader::restoreScrollPositionAndViewState()
// previous height
bool canRestoreWithoutClamping = view->clampOffsetAtScale(m_currentItem->scrollPoint(), 1) == m_currentItem->scrollPoint();
bool canRestoreWithoutAnnoyingUser = !documentLoader()->initialScrollState().wasScrolledByUser
- && (canRestoreWithoutClamping || m_frame->isLoading() || !shouldRestoreScroll);
+ && (canRestoreWithoutClamping || !m_frame->isLoading() || !shouldRestoreScroll);
if (!canRestoreWithoutAnnoyingUser)
return;
« no previous file with comments | « LayoutTests/fast/loader/scroll-position-restoration-without-premature-clamping-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698