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

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

Issue 2890313003: Commands preserve handles (Closed)
Patch Set: Addressed yosin's comments 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
Index: third_party/WebKit/Source/core/editing/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index c1dd947b5c49979f71cbd582d02361fc15225a20..da630cfd3b83cc1d1baa2362f1bd67ea6ae08a1e 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -1499,7 +1499,11 @@ void Editor::ChangeSelectionAfterCommand(
// Ranges for selections that are no longer valid
bool selection_did_not_change_dom_position =
new_selection == GetFrame().Selection().GetSelectionInDOMTree();
- GetFrame().Selection().SetSelection(new_selection, options);
+ GetFrame().Selection().SetSelection(
+ SelectionInDOMTree::Builder(new_selection)
+ .SetIsHandleVisible(GetFrame().Selection().IsHandleVisible())
+ .Build(),
+ options);
// Some editing operations change the selection visually without affecting its
// position within the DOM. For example when you press return in the following

Powered by Google App Engine
This is Rietveld 408576698