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

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

Issue 1201423002: Use VisibleSelection::InDOMTree::equalSelections() instead of operator==() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-06-24T15:30:20 Rebase - exclude FrameSelection Created 5 years, 6 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: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index 9c8d5c782a89505c02842fd7d0d80745a24bce75..272259e810ca9bb07fe45001791218e6f3edbf6f 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -1042,7 +1042,7 @@ void Editor::transpose()
String transposed = text.right(1) + text.left(1);
// Select the two characters.
- if (newSelection != frame().selection().selection())
+ if (!VisibleSelection::InDOMTree::equalSelections(newSelection, frame().selection().selection()))
frame().selection().setSelection(newSelection);
// Insert the transposed characters.
@@ -1069,7 +1069,7 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection,
return;
// See <rdar://problem/5729315> Some shouldChangeSelectedDOMRange contain Ranges for selections that are no longer valid
- bool selectionDidNotChangeDOMPosition = newSelection == frame().selection().selection();
+ bool selectionDidNotChangeDOMPosition = VisibleSelection::InDOMTree::equalSelections(newSelection, frame().selection().selection());
frame().selection().setSelection(newSelection, options);
// Some editing operations change the selection visually without affecting its position within the DOM.

Powered by Google App Engine
This is Rietveld 408576698