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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2628683003: Add DidSaveScrollOrScaleState flag to prevent restoreScrollPositionAndViewState restore from default (Closed)
Patch Set: Nate's Comment addressed Created 3 years, 11 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 9985fcf17ee6f5096f710bf35ea8f955a09db7b3..a9b006a5e0fd2e577dc4ce1481377b358d96025b 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -273,6 +273,11 @@ void FrameView::reset() {
m_orthogonalWritingModeRootList.clear();
}
+void FrameView::setScrollFromNavigation() {
majidvp 2017/01/24 21:53:52 nit: please match the declaration order in header
+ scrollToFragmentAnchor();
majidvp 2017/01/24 21:53:52 In this case, scrollToFragment does not honor his
chaopeng 2017/01/25 15:22:38 No, in this case m_fragmentAnchor is null and scro
majidvp 2017/01/25 20:31:59 Are you sure? If the fragmentAnchor is always nil
+ frame().loader().restoreScrollPositionAndViewState();
+}
+
// Call function for each non-throttled frame view in pre tree order.
// Note it needs a null check of the frame's layoutView to access it in case of
// detached frames.
@@ -547,7 +552,7 @@ void FrameView::setFrameRect(const IntRect& newRect) {
if (m_frame->isMainFrame())
m_frame->host()->visualViewport().mainFrameDidChangeSize();
- frame().loader().restoreScrollPositionAndViewState();
+ setScrollFromNavigation();
}
}
@@ -668,10 +673,7 @@ void FrameView::setContentsSize(const IntSize& size) {
page->chromeClient().contentsSizeChanged(m_frame.get(), size);
- // Ensure the scrollToFragmentAnchor is called before
- // restoreScrollPositionAndViewState when reload
- scrollToFragmentAnchor();
- frame().loader().restoreScrollPositionAndViewState();
+ setScrollFromNavigation();
}
void FrameView::adjustViewSize() {

Powered by Google App Engine
This is Rietveld 408576698