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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 !(Selection() | 1038 !(Selection() |
1039 .ComputeVisibleSelectionInDOMTreeDeprecated() | 1039 .ComputeVisibleSelectionInDOMTreeDeprecated() |
1040 .IsContentEditable() || | 1040 .IsContentEditable() || |
1041 (mev.InnerNode() && mev.InnerNode()->IsTextNode()))) | 1041 (mev.InnerNode() && mev.InnerNode()->IsTextNode()))) |
1042 return; | 1042 return; |
1043 | 1043 |
1044 // Context menu events are always allowed to perform a selection. | 1044 // Context menu events are always allowed to perform a selection. |
1045 AutoReset<bool> mouse_down_may_start_select_change( | 1045 AutoReset<bool> mouse_down_may_start_select_change( |
1046 &mouse_down_may_start_select_, true); | 1046 &mouse_down_may_start_select_, true); |
1047 | 1047 |
1048 if (HitTestResultIsMisspelled(mev.GetHitTestResult())) | 1048 if (HitTestResultIsMisspelled(mev.GetHitTestResult()) && |
| 1049 !mev.Event().FromTouch()) |
1049 return SelectClosestMisspellingFromMouseEvent(mev); | 1050 return SelectClosestMisspellingFromMouseEvent(mev); |
1050 | 1051 |
1051 if (!frame_->GetEditor().Behavior().ShouldSelectOnContextualMenuClick()) | 1052 if (!frame_->GetEditor().Behavior().ShouldSelectOnContextualMenuClick()) |
1052 return; | 1053 return; |
1053 | 1054 |
1054 SelectClosestWordOrLinkFromMouseEvent(mev); | 1055 SelectClosestWordOrLinkFromMouseEvent(mev); |
1055 } | 1056 } |
1056 | 1057 |
1057 void SelectionController::PassMousePressEventToSubframe( | 1058 void SelectionController::PassMousePressEventToSubframe( |
1058 const MouseEventWithHitTestResults& mev) { | 1059 const MouseEventWithHitTestResults& mev) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 | 1132 |
1132 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { | 1133 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { |
1133 bool is_mouse_down_on_link_or_image = | 1134 bool is_mouse_down_on_link_or_image = |
1134 event.IsOverLink() || event.GetHitTestResult().GetImage(); | 1135 event.IsOverLink() || event.GetHitTestResult().GetImage(); |
1135 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != | 1136 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != |
1136 0 && | 1137 0 && |
1137 !is_mouse_down_on_link_or_image; | 1138 !is_mouse_down_on_link_or_image; |
1138 } | 1139 } |
1139 | 1140 |
1140 } // namespace blink | 1141 } // namespace blink |
OLD | NEW |