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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.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/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 6dd54001587b8793c2427a3817dc2ad4c4f751d5..dd4dbaaf2b546a0ca3e6365b97dec2e2bb5445bd 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -410,7 +410,7 @@ WebInputEventResult EventHandler::handleMousePressEvent(const MouseEventWithHitT
bool singleClick = event.event().clickCount() <= 1;
- m_mouseDownMayStartDrag = singleClick;
+ m_mouseDownMayStartDrag = singleClick && !mayBeLinkSelection(event);
selectionController().handleMousePressEvent(event);
@@ -951,7 +951,8 @@ OptionalCursor EventHandler::selectAutoCursor(const HitTestResult& result, Node*
{
bool editable = (node && node->hasEditableStyle());
- if (useHandCursor(node, result.isOverLink()))
+ const bool isOverLink = !selectionController().mouseDownMayStartSelect() && result.isOverLink();
kotenkov 2016/03/09 17:27:59 This is needed so that there is a beam cursor when
+ if (useHandCursor(node, isOverLink))
return handCursor();
bool inResizer = false;
@@ -1375,7 +1376,12 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
#endif
WebInputEventResult clickEventResult = WebInputEventResult::NotHandled;
- if (m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode && mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canParticipateInFlatTree()) {
+ const bool shouldDispatchClickEvent = m_clickCount > 0
+ && !contextMenuEvent
+ && mev.innerNode() && m_clickNode
+ && mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canParticipateInFlatTree()
+ && !(selectionController().hasExtendedSelection() && mayBeLinkSelection(mev));
kotenkov 2016/03/09 17:27:59 This is needed so that no click event is sent when
+ if (shouldDispatchClickEvent) {
// Updates distribution because a 'mouseup' event listener can make the
// tree dirty at dispatchMouseEvent() invocation above.
// Unless distribution is updated, commonAncestor would hit ASSERT.

Powered by Google App Engine
This is Rietveld 408576698