| 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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 const MouseEventWithHitTestResults& mev, | 980 const MouseEventWithHitTestResults& mev, |
| 981 const LayoutPoint& position) { | 981 const LayoutPoint& position) { |
| 982 if (!selection().isAvailable()) | 982 if (!selection().isAvailable()) |
| 983 return; | 983 return; |
| 984 if (selection().contains(position) || mev.scrollbar() || | 984 if (selection().contains(position) || mev.scrollbar() || |
| 985 // FIXME: In the editable case, word selection sometimes selects content | 985 // FIXME: In the editable case, word selection sometimes selects content |
| 986 // that isn't underneath the mouse. | 986 // that isn't underneath the mouse. |
| 987 // If the selection is non-editable, we do word selection to make it | 987 // If the selection is non-editable, we do word selection to make it |
| 988 // easier to use the contextual menu items available for text selections. | 988 // easier to use the contextual menu items available for text selections. |
| 989 // But only if we're above text. | 989 // But only if we're above text. |
| 990 !(selection().isContentEditable() || | 990 !(selection() |
| 991 .computeVisibleSelectionInDOMTreeDeprecated() |
| 992 .isContentEditable() || |
| 991 (mev.innerNode() && mev.innerNode()->isTextNode()))) | 993 (mev.innerNode() && mev.innerNode()->isTextNode()))) |
| 992 return; | 994 return; |
| 993 | 995 |
| 994 // Context menu events are always allowed to perform a selection. | 996 // Context menu events are always allowed to perform a selection. |
| 995 AutoReset<bool> mouseDownMayStartSelectChange(&m_mouseDownMayStartSelect, | 997 AutoReset<bool> mouseDownMayStartSelectChange(&m_mouseDownMayStartSelect, |
| 996 true); | 998 true); |
| 997 | 999 |
| 998 if (hitTestResultIsMisspelled(mev.hitTestResult())) | 1000 if (hitTestResultIsMisspelled(mev.hitTestResult())) |
| 999 return selectClosestMisspellingFromMouseEvent(mev); | 1001 return selectClosestMisspellingFromMouseEvent(mev); |
| 1000 | 1002 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 | 1081 |
| 1080 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { | 1082 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { |
| 1081 bool isMouseDownOnLinkOrImage = | 1083 bool isMouseDownOnLinkOrImage = |
| 1082 event.isOverLink() || event.hitTestResult().image(); | 1084 event.isOverLink() || event.hitTestResult().image(); |
| 1083 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != | 1085 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != |
| 1084 0 && | 1086 0 && |
| 1085 !isMouseDownOnLinkOrImage; | 1087 !isMouseDownOnLinkOrImage; |
| 1086 } | 1088 } |
| 1087 | 1089 |
| 1088 } // namespace blink | 1090 } // namespace blink |
| OLD | NEW |