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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 1774123006: Implement link selection on alt+mouse drag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index e26e1732d57ef92bb4111b2507ed4856c894f2d5..df6b0ccabfb4950a5d61949b1d4f27119b6fd98c 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -432,7 +432,8 @@ void SelectionController::handleMousePressEvent(const MouseEventWithHitTestResul
{
// If we got the event back, that must mean it wasn't prevented,
// so it's allowed to start a drag or selection if it wasn't in a scrollbar.
- m_mouseDownMayStartSelect = canMouseDownStartSelect(event.innerNode()) && !event.scrollbar();
+ m_mouseDownMayStartSelect = (canMouseDownStartSelect(event.innerNode()) || mayBeLinkSelection(event))
+ && !event.scrollbar();
m_mouseDownWasSingleClickInSelection = false;
// Avoid double-tap touch gesture confusion by restricting multi-click side
// effects, e.g., word selection, to editable regions.
@@ -562,7 +563,8 @@ void SelectionController::sendContextMenuEvent(const MouseEventWithHitTestResult
|| !(selection().isContentEditable() || (mev.innerNode() && mev.innerNode()->isTextNode())))
return;
- m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
+ // Context menu events are always allowed to perform a selection.
+ TemporaryChange<bool> mouseDownMayStartSelectChange(m_mouseDownMayStartSelect, true);
if (mev.hitTestResult().isMisspelled())
return selectClosestMisspellingFromMouseEvent(mev);

Powered by Google App Engine
This is Rietveld 408576698