OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
6 * Copyright (C) 2015 Google Inc. All rights reserved. | 6 * Copyright (C) 2015 Google Inc. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 return true; | 435 return true; |
436 } | 436 } |
437 | 437 |
438 bool SelectionController::selectClosestWordFromHitTestResult( | 438 bool SelectionController::selectClosestWordFromHitTestResult( |
439 const HitTestResult& result, | 439 const HitTestResult& result, |
440 AppendTrailingWhitespace appendTrailingWhitespace, | 440 AppendTrailingWhitespace appendTrailingWhitespace, |
441 SelectInputEventType selectInputEventType) { | 441 SelectInputEventType selectInputEventType) { |
442 Node* innerNode = result.innerNode(); | 442 Node* innerNode = result.innerNode(); |
443 VisibleSelectionInFlatTree newSelection; | 443 VisibleSelectionInFlatTree newSelection; |
444 | 444 |
445 if (!innerNode || !innerNode->layoutObject()) | 445 if (!innerNode || !innerNode->layoutObject() || |
| 446 !innerNode->layoutObject()->isSelectable()) |
446 return false; | 447 return false; |
447 | 448 |
448 // Special-case image local offset to always be zero, to avoid triggering | 449 // Special-case image local offset to always be zero, to avoid triggering |
449 // LayoutReplaced::positionFromPoint's advancement of the position at the | 450 // LayoutReplaced::positionFromPoint's advancement of the position at the |
450 // mid-point of the the image (which was intended for mouse-drag selection | 451 // mid-point of the the image (which was intended for mouse-drag selection |
451 // and isn't desirable for touch). | 452 // and isn't desirable for touch). |
452 HitTestResult adjustedHitTestResult = result; | 453 HitTestResult adjustedHitTestResult = result; |
453 if (selectInputEventType == SelectInputEventType::Touch && result.image()) | 454 if (selectInputEventType == SelectInputEventType::Touch && result.image()) |
454 adjustedHitTestResult.setNodeAndPosition(result.innerNode(), | 455 adjustedHitTestResult.setNodeAndPosition(result.innerNode(), |
455 LayoutPoint(0, 0)); | 456 LayoutPoint(0, 0)); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1091 | 1092 |
1092 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { | 1093 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { |
1093 bool isMouseDownOnLinkOrImage = | 1094 bool isMouseDownOnLinkOrImage = |
1094 event.isOverLink() || event.hitTestResult().image(); | 1095 event.isOverLink() || event.hitTestResult().image(); |
1095 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != | 1096 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != |
1096 0 && | 1097 0 && |
1097 !isMouseDownOnLinkOrImage; | 1098 !isMouseDownOnLinkOrImage; |
1098 } | 1099 } |
1099 | 1100 |
1100 } // namespace blink | 1101 } // namespace blink |
OLD | NEW |