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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 const HitTestResult& hitTestResult) { | 839 const HitTestResult& hitTestResult) { |
840 if (!selection().isAvailable()) | 840 if (!selection().isAvailable()) |
841 return false; | 841 return false; |
842 if (hitTestResult.isLiveLink()) | 842 if (hitTestResult.isLiveLink()) |
843 return false; | 843 return false; |
844 | 844 |
845 Node* innerNode = hitTestResult.innerNode(); | 845 Node* innerNode = hitTestResult.innerNode(); |
846 if (!innerNode) | 846 if (!innerNode) |
847 return false; | 847 return false; |
848 innerNode->document().updateStyleAndLayoutTree(); | 848 innerNode->document().updateStyleAndLayoutTree(); |
849 bool innerNodeIsSelectable = | 849 bool innerNodeIsSelectable = hasEditableStyle(*innerNode) || |
850 hasEditableStyle(*innerNode) || innerNode->canStartSelection(); | 850 innerNode->isTextNode() || |
| 851 innerNode->canStartSelection(); |
851 if (!innerNodeIsSelectable) | 852 if (!innerNodeIsSelectable) |
852 return false; | 853 return false; |
853 | 854 |
854 selectClosestWordFromHitTestResult(hitTestResult, | 855 selectClosestWordFromHitTestResult(hitTestResult, |
855 AppendTrailingWhitespace::DontAppend, | 856 AppendTrailingWhitespace::DontAppend, |
856 SelectInputEventType::Touch); | 857 SelectInputEventType::Touch); |
857 if (!selection().isAvailable()) { | 858 if (!selection().isAvailable()) { |
858 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" | 859 // "editing/selection/longpress-selection-in-iframe-removed-crash.html" |
859 // reach here. | 860 // reach here. |
860 return false; | 861 return false; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 return event.event().altKey() && event.isOverLink(); | 966 return event.event().altKey() && event.isOverLink(); |
966 } | 967 } |
967 | 968 |
968 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { | 969 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { |
969 bool isMouseDownOnLinkOrImage = | 970 bool isMouseDownOnLinkOrImage = |
970 event.isOverLink() || event.hitTestResult().image(); | 971 event.isOverLink() || event.hitTestResult().image(); |
971 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; | 972 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; |
972 } | 973 } |
973 | 974 |
974 } // namespace blink | 975 } // namespace blink |
OLD | NEW |