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

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

Issue 2628683003: Add DidSaveScrollOrScaleState flag to prevent restoreScrollPositionAndViewState restore from default (Closed)
Patch Set: add dump file Created 3 years, 10 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
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 26bd2f95c92e404ed37be2e1c80177c58efb2a69..3f62008d853e5726fe1ca61f37795fa197d8e713 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -36,6 +36,7 @@
#include "core/loader/FrameLoader.h"
+#include <memory>
#include "bindings/core/v8/DOMWrapperWorld.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/SerializedScriptValue.h"
@@ -102,7 +103,6 @@
#include "wtf/AutoReset.h"
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
-#include <memory>
using blink::WebURLRequest;
@@ -421,6 +421,8 @@ void FrameLoader::setHistoryItemStateForCommit(
return;
m_currentItem->setDocumentSequenceNumber(oldItem->documentSequenceNumber());
m_currentItem->setScrollOffset(oldItem->getScrollOffset());
+ m_currentItem->setDidSaveScrollOrScaleState(
+ oldItem->didSaveScrollOrScaleState());
m_currentItem->setVisualViewportScrollOffset(
oldItem->visualViewportScrollOffset());
m_currentItem->setPageScaleFactor(oldItem->pageScaleFactor());
@@ -1414,6 +1416,8 @@ void FrameLoader::restoreScrollPositionAndViewStateForLoadType(
}
if (!needsHistoryItemRestore(loadType))
return;
+ if (!m_currentItem->didSaveScrollOrScaleState())
+ return;
bool shouldRestoreScroll =
m_currentItem->scrollRestorationType() != ScrollRestorationManual;
« no previous file with comments | « content/test/data/page_state/serialized_v23.dat ('k') | third_party/WebKit/Source/core/loader/HistoryItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698