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..d348c387dc112c462cb10a95dd47f050ba99a1f6 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); |
@@ -623,4 +625,9 @@ FrameSelection& SelectionController::selection() const |
return m_frame->selection(); |
} |
+bool mayBeLinkSelection(const MouseEventWithHitTestResults& event) |
tkent
2016/03/25 03:33:02
This looks "isLinkSelection" to me. Why "mayBe"?
|
+{ |
+ return event.event().altKey() && event.isOverLink(); |
+} |
+ |
} // namespace blink |