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

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

Issue 2864833002: Tapping handle shouldn't select misspelled word (Closed)
Patch Set: fixed bokan's nits 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 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 !(Selection() 1040 !(Selection()
1041 .ComputeVisibleSelectionInDOMTreeDeprecated() 1041 .ComputeVisibleSelectionInDOMTreeDeprecated()
1042 .IsContentEditable() || 1042 .IsContentEditable() ||
1043 (mev.InnerNode() && mev.InnerNode()->IsTextNode()))) 1043 (mev.InnerNode() && mev.InnerNode()->IsTextNode())))
1044 return; 1044 return;
1045 1045
1046 // Context menu events are always allowed to perform a selection. 1046 // Context menu events are always allowed to perform a selection.
1047 AutoReset<bool> mouse_down_may_start_select_change( 1047 AutoReset<bool> mouse_down_may_start_select_change(
1048 &mouse_down_may_start_select_, true); 1048 &mouse_down_may_start_select_, true);
1049 1049
1050 if (HitTestResultIsMisspelled(mev.GetHitTestResult())) 1050 if (HitTestResultIsMisspelled(mev.GetHitTestResult()) &&
yosin_UTC9 2017/05/24 05:08:38 It is better to check |FromTouch()| before calling
amaralp1 2017/05/24 05:33:27 Done.
1051 !mev.Event().FromTouch())
1051 return SelectClosestMisspellingFromMouseEvent(mev); 1052 return SelectClosestMisspellingFromMouseEvent(mev);
1052 1053
1053 if (!frame_->GetEditor().Behavior().ShouldSelectOnContextualMenuClick()) 1054 if (!frame_->GetEditor().Behavior().ShouldSelectOnContextualMenuClick())
1054 return; 1055 return;
1055 1056
1056 SelectClosestWordOrLinkFromMouseEvent(mev); 1057 SelectClosestWordOrLinkFromMouseEvent(mev);
1057 } 1058 }
1058 1059
1059 void SelectionController::PassMousePressEventToSubframe( 1060 void SelectionController::PassMousePressEventToSubframe(
1060 const MouseEventWithHitTestResults& mev) { 1061 const MouseEventWithHitTestResults& mev) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 1134
1134 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) { 1135 bool IsExtendingSelection(const MouseEventWithHitTestResults& event) {
1135 bool is_mouse_down_on_link_or_image = 1136 bool is_mouse_down_on_link_or_image =
1136 event.IsOverLink() || event.GetHitTestResult().GetImage(); 1137 event.IsOverLink() || event.GetHitTestResult().GetImage();
1137 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) != 1138 return (event.Event().GetModifiers() & WebInputEvent::Modifiers::kShiftKey) !=
1138 0 && 1139 0 &&
1139 !is_mouse_down_on_link_or_image; 1140 !is_mouse_down_on_link_or_image;
1140 } 1141 }
1141 1142
1142 } // namespace blink 1143 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698