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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 3 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/spellcheck/SpellChecker.cpp
diff --git a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
index f1e60f04403c4968c595a9b03500fdd841ee4115..61c6bb3558efb3d6d14385ce09c6dad89aa43f84 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -298,7 +298,7 @@ void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection)
// a marker so we draw the red squiggle later.
const EphemeralRange misspellingRange = calculateCharacterSubrange(EphemeralRange(spellingSearchStart, spellingSearchEnd), misspellingOffset, misspelledWord.length());
- frame().selection().setSelection(VisibleSelection(misspellingRange));
+ frame().selection().setSelection(createVisibleSelectionDeprecated(misspellingRange));
frame().selection().revealSelection();
spellCheckerClient().updateSpellingUIWithMisspelledWord(misspelledWord);
frame().document()->markers().addMarker(misspellingRange.startPosition(), misspellingRange.endPosition(), DocumentMarker::Spelling);
@@ -394,7 +394,7 @@ void SpellChecker::markMisspellingsAfterTypingCommand(const TypingCommand& cmd)
if (cmd.commandTypeOfOpenCommand() == TypingCommand::InsertParagraphSeparator) {
VisiblePosition nextWord = nextWordPosition(start);
- VisibleSelection words(wordStartOfPrevious, endOfWord(nextWord));
+ VisibleSelection words = createVisibleSelectionDeprecated(wordStartOfPrevious, endOfWord(nextWord));
markMisspellingsAfterLineBreak(words);
return;
}
@@ -418,7 +418,7 @@ void SpellChecker::markMisspellingsAfterTypingToWord(const VisiblePosition &word
{
TRACE_EVENT0("blink", "SpellChecker::markMisspellingsAfterTypingToWord");
- VisibleSelection adjacentWords = VisibleSelection(startOfWord(wordStart, LeftWordIfOnBoundary), endOfWord(wordStart, RightWordIfOnBoundary));
+ VisibleSelection adjacentWords = createVisibleSelectionDeprecated(startOfWord(wordStart, LeftWordIfOnBoundary), endOfWord(wordStart, RightWordIfOnBoundary));
markMisspellingsAndBadGrammar(adjacentWords);
}
@@ -698,7 +698,7 @@ void SpellChecker::replaceMisspelledRange(const String& text)
EphemeralRange markerRange = EphemeralRange(Position(caretRange.startPosition().computeContainerNode(), markers[0]->startOffset()), Position(caretRange.endPosition().computeContainerNode(), markers[0]->endOffset()));
if (markerRange.isNull())
return;
- frame().selection().setSelection(VisibleSelection(markerRange), CharacterGranularity);
+ frame().selection().setSelection(createVisibleSelectionDeprecated(markerRange), CharacterGranularity);
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
@@ -760,7 +760,7 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio
const bool caretBrowsing = frame().settings() && frame().settings()->caretBrowsingEnabled();
if (newSelection.isContentEditable() || caretBrowsing) {
const VisiblePosition newStart(newSelection.visibleStart());
- newAdjacentWords = VisibleSelection(startOfWord(newStart, LeftWordIfOnBoundary), endOfWord(newStart, RightWordIfOnBoundary));
+ newAdjacentWords = createVisibleSelectionDeprecated(startOfWord(newStart, LeftWordIfOnBoundary), endOfWord(newStart, RightWordIfOnBoundary));
}
}
@@ -816,7 +816,7 @@ void SpellChecker::spellCheckOldSelection(const VisibleSelection& oldSelection,
TRACE_EVENT0("blink", "SpellChecker::spellCheckOldSelection");
VisiblePosition oldStart(oldSelection.visibleStart());
- VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
+ VisibleSelection oldAdjacentWords = createVisibleSelectionDeprecated(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
if (oldAdjacentWords == newAdjacentWords)
return;
markMisspellingsAndBadGrammar(oldAdjacentWords);

Powered by Google App Engine
This is Rietveld 408576698