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

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

Issue 2628683003: Add DidSaveScrollOrScaleState flag to prevent restoreScrollPositionAndViewState restore from default (Closed)
Patch Set: remove checkComplete call in loadInSameDocument 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..fd33a47925f31116d4d81996181b645a2f9704eb 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -520,6 +520,11 @@ void FrameView::invalidateRect(const IntRect& rect) {
layoutItem.invalidatePaintRectangle(LayoutRect(paintInvalidationRect));
}
+void FrameView::setScrollAfterSizeChange() {
+ scrollToFragmentAnchor();
+ frame().loader().restoreScrollPositionAndViewState();
+}
+
void FrameView::setFrameRect(const IntRect& newRect) {
IntRect oldRect = frameRect();
if (newRect == oldRect)
@@ -547,7 +552,7 @@ void FrameView::setFrameRect(const IntRect& newRect) {
if (m_frame->isMainFrame())
m_frame->host()->visualViewport().mainFrameDidChangeSize();
- frame().loader().restoreScrollPositionAndViewState();
+ setScrollAfterSizeChange();
}
}
@@ -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();
+ setScrollAfterSizeChange();
}
void FrameView::adjustViewSize() {

Powered by Google App Engine
This is Rietveld 408576698