| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 5 * Copyright (C) 2015 Google Inc. All rights reserved. | 5 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 } | 571 } |
| 572 | 572 |
| 573 bool SelectionController::handleGestureLongPress(const PlatformGestureEvent& ges
tureEvent, const HitTestResult& hitTestResult) | 573 bool SelectionController::handleGestureLongPress(const PlatformGestureEvent& ges
tureEvent, const HitTestResult& hitTestResult) |
| 574 { | 574 { |
| 575 if (!selection().isAvailable()) | 575 if (!selection().isAvailable()) |
| 576 return false; | 576 return false; |
| 577 if (hitTestResult.isLiveLink()) | 577 if (hitTestResult.isLiveLink()) |
| 578 return false; | 578 return false; |
| 579 | 579 |
| 580 Node* innerNode = hitTestResult.innerNode(); | 580 Node* innerNode = hitTestResult.innerNode(); |
| 581 bool innerNodeIsSelectable = innerNode && (innerNode->isContentEditable() ||
innerNode->isTextNode() || innerNode->canStartSelection()); | 581 bool innerNodeIsSelectable = innerNode && (innerNode->isContentEditable() ||
innerNode->canStartSelection()); |
| 582 if (!innerNodeIsSelectable) | 582 if (!innerNodeIsSelectable) |
| 583 return false; | 583 return false; |
| 584 | 584 |
| 585 selectClosestWordFromHitTestResult(hitTestResult, AppendTrailingWhitespace::
DontAppend, SelectInputEventType::Touch); | 585 selectClosestWordFromHitTestResult(hitTestResult, AppendTrailingWhitespace::
DontAppend, SelectInputEventType::Touch); |
| 586 if (!selection().isAvailable()) { | 586 if (!selection().isAvailable()) { |
| 587 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" | 587 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" |
| 588 // reach here. | 588 // reach here. |
| 589 return false; | 589 return false; |
| 590 } | 590 } |
| 591 return selection().isRange(); | 591 return selection().isRange(); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 { | 664 { |
| 665 return m_frame->selection(); | 665 return m_frame->selection(); |
| 666 } | 666 } |
| 667 | 667 |
| 668 bool isLinkSelection(const MouseEventWithHitTestResults& event) | 668 bool isLinkSelection(const MouseEventWithHitTestResults& event) |
| 669 { | 669 { |
| 670 return event.event().altKey() && event.isOverLink(); | 670 return event.event().altKey() && event.isOverLink(); |
| 671 } | 671 } |
| 672 | 672 |
| 673 } // namespace blink | 673 } // namespace blink |
| OLD | NEW |