Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Side by Side Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2864833002: Tapping handle shouldn't select misspelled word (Closed)
Patch Set: fix naming Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 !(Selection() 1041 !(Selection()
1042 .ComputeVisibleSelectionInDOMTreeDeprecated() 1042 .ComputeVisibleSelectionInDOMTreeDeprecated()
1043 .IsContentEditable() || 1043 .IsContentEditable() ||
1044 (mev.InnerNode() && mev.InnerNode()->IsTextNode()))) 1044 (mev.InnerNode() && mev.InnerNode()->IsTextNode())))
1045 return; 1045 return;
1046 1046
1047 // Context menu events are always allowed to perform a selection. 1047 // Context menu events are always allowed to perform a selection.
1048 AutoReset<bool> mouse_down_may_start_select_change( 1048 AutoReset<bool> mouse_down_may_start_select_change(
1049 &mouse_down_may_start_select_, true); 1049 &mouse_down_may_start_select_, true);
1050 1050
1051 if (HitTestResultIsMisspelled(mev.GetHitTestResult())) 1051 if (HitTestResultIsMisspelled(mev.GetHitTestResult()) &&
1052 !mev.Event().FromTouch())
bokan 2017/05/09 23:21:36 This would inadvertently affect context menus comi
1052 return SelectClosestMisspellingFromMouseEvent(mev); 1053 return SelectClosestMisspellingFromMouseEvent(mev);
1053 1054
1054 if (!frame_->GetEditor().Behavior().ShouldSelectOnContextualMenuClick()) 1055 if (!frame_->GetEditor().Behavior().ShouldSelectOnContextualMenuClick())
1055 return; 1056 return;
1056 1057
1057 SelectClosestWordOrLinkFromMouseEvent(mev); 1058 SelectClosestWordOrLinkFromMouseEvent(mev);
1058 } 1059 }
1059 1060
1060 void SelectionController::PassMousePressEventToSubframe( 1061 void SelectionController::PassMousePressEventToSubframe(
1061 const MouseEventWithHitTestResults& mev) { 1062 const MouseEventWithHitTestResults& mev) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 1135
1135 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { 1136 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) {
1136 bool is_mouse_down_on_link_or_image = 1137 bool is_mouse_down_on_link_or_image =
1137 event.IsOverLink() || event.GetHitTestResult().GetImage(); 1138 event.IsOverLink() || event.GetHitTestResult().GetImage();
1138 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != 1139 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) !=
1139 0 && 1140 0 &&
1140 !is_mouse_down_on_link_or_image; 1141 !is_mouse_down_on_link_or_image;
1141 } 1142 }
1142 1143
1143 } // namespace blink 1144 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698