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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2891693002: Make mouse drag to ignore unfocused selection (Closed)
Patch Set: 2017-05-19T15:07:18 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/mouse/drag_user_select_none.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/SelectionController.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index 444584d6264a490b8b8483f2cafcc927abd3bc46..89f86731d3aaf003d5e9eb34faa355a18c0d09de 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -353,9 +353,11 @@ void SelectionController::UpdateSelectionForMouseDrag(
frame_->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets();
const PositionWithAffinity& raw_target_position =
- PositionRespectingEditingBoundary(
- Selection().ComputeVisibleSelectionInDOMTree().Start(),
- hit_test_result.LocalPoint(), target);
+ Selection().SelectionHasFocus()
+ ? PositionRespectingEditingBoundary(
+ Selection().ComputeVisibleSelectionInDOMTree().Start(),
+ hit_test_result.LocalPoint(), target)
+ : PositionWithAffinity();
VisiblePositionInFlatTree target_position = CreateVisiblePosition(
FromPositionInDOMTree<EditingInFlatTreeStrategy>(raw_target_position));
// Don't modify the selection if we're not on a node.
« no previous file with comments | « third_party/WebKit/LayoutTests/editing/selection/mouse/drag_user_select_none.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698