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

Unified Diff: third_party/WebKit/Source/core/loader/HistoryItem.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/HistoryItem.cpp
diff --git a/third_party/WebKit/Source/core/loader/HistoryItem.cpp b/third_party/WebKit/Source/core/loader/HistoryItem.cpp
index 28340e438aca7ea09e732fa0a80eb42f7419f7ac..2978583d7b1377f7322d6312fde46a71462622f9 100644
--- a/third_party/WebKit/Source/core/loader/HistoryItem.cpp
+++ b/third_party/WebKit/Source/core/loader/HistoryItem.cpp
@@ -43,7 +43,8 @@ static long long generateSequenceNumber() {
}
HistoryItem::HistoryItem()
- : m_pageScaleFactor(0),
+ : m_didSaveScrollOrScaleState(false),
+ m_pageScaleFactor(0),
m_itemSequenceNumber(generateSequenceNumber()),
m_documentSequenceNumber(generateSequenceNumber()),
m_scrollRestorationType(ScrollRestorationAuto) {}
@@ -91,6 +92,7 @@ const ScrollOffset& HistoryItem::visualViewportScrollOffset() const {
void HistoryItem::setVisualViewportScrollOffset(const ScrollOffset& offset) {
m_visualViewportScrollOffset = offset;
+ setDidSaveScrollOrScaleState(true);
}
const ScrollOffset& HistoryItem::getScrollOffset() const {
@@ -99,6 +101,7 @@ const ScrollOffset& HistoryItem::getScrollOffset() const {
void HistoryItem::setScrollOffset(const ScrollOffset& offset) {
m_scrollOffset = offset;
+ setDidSaveScrollOrScaleState(true);
}
float HistoryItem::pageScaleFactor() const {
@@ -107,6 +110,7 @@ float HistoryItem::pageScaleFactor() const {
void HistoryItem::setPageScaleFactor(float scaleFactor) {
m_pageScaleFactor = scaleFactor;
+ setDidSaveScrollOrScaleState(true);
}
void HistoryItem::setDocumentState(const Vector<String>& state) {
« no previous file with comments | « third_party/WebKit/Source/core/loader/HistoryItem.h ('k') | third_party/WebKit/Source/web/WebHistoryItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698