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

Unified Diff: Source/core/editing/TypingCommand.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/TypingCommand.cpp
diff --git a/Source/core/editing/TypingCommand.cpp b/Source/core/editing/TypingCommand.cpp
index ee083dbf4c29818b87ae4d19846852d34ac57a75..abb01867e62374312fccfd031ee84eb06d025494 100644
--- a/Source/core/editing/TypingCommand.cpp
+++ b/Source/core/editing/TypingCommand.cpp
@@ -148,7 +148,7 @@ void TypingCommand::updateSelectionIfDifferentFromCurrentSelection(TypingCommand
{
ASSERT(frame);
VisibleSelection currentSelection = frame->selection().selection();
- if (currentSelection == typingCommand->endingSelection())
+ if (VisibleSelection::InDOMTree::equalSelections(currentSelection, typingCommand->endingSelection()))
return;
typingCommand->setStartingSelection(currentSelection);
@@ -180,7 +180,7 @@ void TypingCommand::insertText(Document& document, const String& text, const Vis
// that is different from the current selection. In the future, we should change EditCommand
// to deal with custom selections in a general way that can be used by all of the commands.
if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame.get())) {
- if (lastTypingCommand->endingSelection() != selectionForInsertion) {
+ if (!VisibleSelection::InDOMTree::equalSelections(lastTypingCommand->endingSelection(), selectionForInsertion)) {
lastTypingCommand->setStartingSelection(selectionForInsertion);
lastTypingCommand->setEndingSelection(selectionForInsertion);
}

Powered by Google App Engine
This is Rietveld 408576698