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

Unified Diff: Source/core/editing/SpellChecker.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/SpellChecker.cpp
diff --git a/Source/core/editing/SpellChecker.cpp b/Source/core/editing/SpellChecker.cpp
index f99aaf9bf645c0cff89bdb7fca066ac385c3e3db..0d485df9d056c0e25440f739958b81b61193eda9 100644
--- a/Source/core/editing/SpellChecker.cpp
+++ b/Source/core/editing/SpellChecker.cpp
@@ -416,7 +416,7 @@ void SpellChecker::markMisspellingsAfterTypingToWord(const VisiblePosition &word
// If autocorrected word is non empty, replace the misspelled word by this word.
if (!autocorrectedString.isEmpty()) {
VisibleSelection newSelection(misspellingRange.get(), DOWNSTREAM);
- if (newSelection != frame().selection().selection()) {
+ if (!VisibleSelection::InDOMTree::equalSelections(newSelection, frame().selection().selection())) {
frame().selection().setSelection(newSelection);
}
@@ -863,7 +863,7 @@ void SpellChecker::spellCheckOldSelection(const VisibleSelection& oldSelection,
{
VisiblePosition oldStart(oldSelection.visibleStart());
VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
- if (oldAdjacentWords != newAdjacentWords) {
+ if (!VisibleSelection::InDOMTree::equalSelections(oldAdjacentWords, newAdjacentWords)) {
if (isContinuousSpellCheckingEnabled() && isGrammarCheckingEnabled()) {
VisibleSelection selectedSentence = VisibleSelection(startOfSentence(oldStart), endOfSentence(oldStart));
markMisspellingsAndBadGrammar(oldAdjacentWords, true, selectedSentence);

Powered by Google App Engine
This is Rietveld 408576698