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

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: Use String instead of std::string. 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..01458400186178142ec52e3531fc12206715d8ce 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 && !isLinkSelection(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();
+ 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() && isLinkSelection(mev));
+ 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