| 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 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 const HitTestResult& hitTestResult) { | 708 const HitTestResult& hitTestResult) { |
| 709 if (!selection().isAvailable()) | 709 if (!selection().isAvailable()) |
| 710 return false; | 710 return false; |
| 711 if (hitTestResult.isLiveLink()) | 711 if (hitTestResult.isLiveLink()) |
| 712 return false; | 712 return false; |
| 713 | 713 |
| 714 Node* innerNode = hitTestResult.innerNode(); | 714 Node* innerNode = hitTestResult.innerNode(); |
| 715 if (!innerNode) | 715 if (!innerNode) |
| 716 return false; | 716 return false; |
| 717 innerNode->document().updateStyleAndLayoutTree(); | 717 innerNode->document().updateStyleAndLayoutTree(); |
| 718 bool innerNodeIsSelectable = | 718 bool innerNodeIsSelectable = hasEditableStyle(*innerNode) || |
| 719 hasEditableStyle(*innerNode) || innerNode->canStartSelection(); | 719 innerNode->isTextNode() || |
| 720 innerNode->canStartSelection(); |
| 720 if (!innerNodeIsSelectable) | 721 if (!innerNodeIsSelectable) |
| 721 return false; | 722 return false; |
| 722 | 723 |
| 723 selectClosestWordFromHitTestResult(hitTestResult, | 724 selectClosestWordFromHitTestResult(hitTestResult, |
| 724 AppendTrailingWhitespace::DontAppend, | 725 AppendTrailingWhitespace::DontAppend, |
| 725 SelectInputEventType::Touch); | 726 SelectInputEventType::Touch); |
| 726 if (!selection().isAvailable()) { | 727 if (!selection().isAvailable()) { |
| 727 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" | 728 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" |
| 728 // reach here. | 729 // reach here. |
| 729 return false; | 730 return false; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 829 return event.event().altKey() && event.isOverLink(); | 830 return event.event().altKey() && event.isOverLink(); |
| 830 } | 831 } |
| 831 | 832 |
| 832 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { | 833 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { |
| 833 bool isMouseDownOnLinkOrImage = | 834 bool isMouseDownOnLinkOrImage = |
| 834 event.isOverLink() || event.hitTestResult().image(); | 835 event.isOverLink() || event.hitTestResult().image(); |
| 835 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; | 836 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; |
| 836 } | 837 } |
| 837 | 838 |
| 838 } // namespace blink | 839 } // namespace blink |
| OLD | NEW |