Chromium Code Reviews| 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 2c317f259e65caae5930dd13894feb023c9c87b5..8924f88ce894ee30dbd8e4d5a40a555dfc77abe4 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,12 @@ bool isLinkSelection(const MouseEventWithHitTestResults& event) |
| return event.event().altKey() && event.isOverLink(); |
| } |
| +bool isExtendingSelection(const MouseEventWithHitTestResults& event) |
| +{ |
| + DCHECK_LE(event.event().clickCount(), 1); |
| + |
|
yosin_UTC9
2016/06/08 01:37:21
nit: no need to have an extra blank line here.
tonikitoo
2016/06/24 18:39:20
The assert was not actually right. I removed it.
|
| + bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult().image(); |
| + return event.event().shiftKey() && !isMouseDownOnLinkOrImage; |
| +} |
| + |
| } // namespace blink |