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 a67560462e77df24084ebd4b2ccb98ddacd915ce..c4b6b9fc3de7814b37a8d1956bef6a394803028e 100644 |
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp |
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp |
@@ -128,8 +128,8 @@ bool SelectionController::handleMousePressEventSingleClick(const MouseEventWithH |
if (!(innerNode && innerNode->layoutObject() && m_mouseDownMayStartSelect)) |
return false; |
- // Extend the selection if the Shift key is down, unless the click is in a link. |
- bool extendSelection = event.event().shiftKey() && !event.isOverLink(); |
+ // Extend the selection if the Shift key is down, unless the click is in a link or image. |
+ bool extendSelection = isExtendingSelection(event); |
// Don't restart the selection when the mouse is pressed on an |
// existing selection so we can allow for text dragging. |
@@ -635,4 +635,10 @@ bool isLinkSelection(const MouseEventWithHitTestResults& event) |
return event.event().altKey() && event.isOverLink(); |
} |
+bool isExtendingSelection(const MouseEventWithHitTestResults& event) |
+{ |
+ bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult().image(); |
+ return event.event().shiftKey() && !isMouseDownOnLinkOrImage; |
+} |
+ |
} // namespace blink |