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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 764313004: Fix the problem to keep the selection when clicking the substring out of range (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index b494da3325acd28ce3d7869fbb6448eaecd65c29..f0d137d89a3bef9bee8cacaa1df385b512276cfb 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -560,8 +560,9 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
granularity = m_frame->selection().granularity();
newSelection.expandUsingGranularity(m_frame->selection().granularity());
}
- } else {
- newSelection = expandSelectionToRespectUserSelectAll(innerNode, VisibleSelection(visiblePos));
+ } else {
Rick Byers 2014/12/02 14:49:39 style nit: combine into one line 'else if {'
Miyoung Shin(g) 2014/12/03 03:39:10 Ok. I will change
+ if (m_selectionInitiationState != ExtendedSelection)
yosin_UTC9 2014/12/03 01:07:00 It seems condition is opposite or should we set |m
Miyoung Shin(g) 2014/12/03 03:39:10 This condition is to check if there is to update t
+ newSelection = expandSelectionToRespectUserSelectAll(innerNode, VisibleSelection(visiblePos));
}
// Updating the selection is considered side-effect of the event and so it doesn't impact the handled state.
@@ -2986,7 +2987,8 @@ void EventHandler::notifyElementActivated()
void EventHandler::notifySelectionChanged()
{
- m_selectionInitiationState = ExtendedSelection;
+ if (m_frame->selection().isRange())
+ m_selectionInitiationState = ExtendedSelection;
}
bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt)

Powered by Google App Engine
This is Rietveld 408576698