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

Unified Diff: Source/core/editing/FrameSelection.cpp

Issue 914573004: Discard scrolling to the saved scroll points if there is any selection done by user. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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: Source/core/editing/FrameSelection.cpp
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
index b4c9085c4eb5408e8f3114a93cfaefdd90f4f718..3e38a1dba4940b7a643d6482584d07ce911b9f6f 100644
--- a/Source/core/editing/FrameSelection.cpp
+++ b/Source/core/editing/FrameSelection.cpp
@@ -1751,6 +1751,14 @@ HTMLFormElement* FrameSelection::currentForm() const
void FrameSelection::revealSelection(const ScrollAlignment& alignment, RevealExtentOption revealExtentOption)
{
+ bool isLoading = !m_frame->document()->loadEventFinished();
+ HistoryItem* currentItem = m_frame->loader().currentItem();
+ FrameView* view = m_frame->view();
+
+ // Ignore scrolling to the focused element if the page already scrolled to stored scroll position in history while page is loading.
+ if (view && isLoading && currentItem && !view->wasScrolledByUser() && currentItem->scrollPoint() != IntPoint::zero() && currentItem->scrollPoint() == view->scrollPosition())
+ return;
+
LayoutRect rect;
switch (selectionType()) {

Powered by Google App Engine
This is Rietveld 408576698