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

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
« no previous file with comments | « LayoutTests/fast/forms/setrangetext-out-of-range-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index b494da3325acd28ce3d7869fbb6448eaecd65c29..16851cb0ac8393e240784595329e74d44c15fb73 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -560,7 +560,7 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR
granularity = m_frame->selection().granularity();
newSelection.expandUsingGranularity(m_frame->selection().granularity());
}
- } else {
+ } else if (m_selectionInitiationState != ExtendedSelection) {
Donn Denman 2014/12/09 00:59:37 This line causes a problem for Contextual Search (
newSelection = expandSelectionToRespectUserSelectAll(innerNode, VisibleSelection(visiblePos));
}
@@ -2986,7 +2986,8 @@ void EventHandler::notifyElementActivated()
void EventHandler::notifySelectionChanged()
{
- m_selectionInitiationState = ExtendedSelection;
+ if (m_frame->selection().isRange())
+ m_selectionInitiationState = ExtendedSelection;
}
bool EventHandler::handleAccessKey(const PlatformKeyboardEvent& evt)
« no previous file with comments | « LayoutTests/fast/forms/setrangetext-out-of-range-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698