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

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

Issue 2390573002: Reland of Prune CreateVisibleSelectionDeprecated from SpellChecker (Closed)
Patch Set: Rebased on clang reformatting Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b2974b099591f2a97833870058dbce9cd7f4d357..387d704c3e4ca8dc33b6ae77b53db22db97ab856 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -323,8 +323,7 @@ void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection) {
const EphemeralRange misspellingRange = calculateCharacterSubrange(
EphemeralRange(spellingSearchStart, spellingSearchEnd),
misspellingOffset, misspelledWord.length());
- frame().selection().setSelection(
- createVisibleSelectionDeprecated(misspellingRange));
+ frame().selection().setSelection(createVisibleSelection(misspellingRange));
frame().selection().revealSelection();
spellCheckerClient().updateSpellingUIWithMisspelledWord(misspelledWord);
frame().document()->markers().addMarker(misspellingRange.startPosition(),
@@ -426,8 +425,8 @@ void SpellChecker::markMisspellingsAfterTypingCommand(
if (cmd.commandTypeOfOpenCommand() ==
TypingCommand::InsertParagraphSeparator) {
VisiblePosition nextWord = nextWordPosition(start);
- VisibleSelection words = createVisibleSelectionDeprecated(
- wordStartOfPrevious, endOfWord(nextWord));
+ VisibleSelection words =
+ createVisibleSelection(wordStartOfPrevious, endOfWord(nextWord));
markMisspellingsAfterLineBreak(words);
return;
}
@@ -451,9 +450,9 @@ void SpellChecker::markMisspellingsAfterTypingToWord(
const VisiblePosition& wordStart) {
TRACE_EVENT0("blink", "SpellChecker::markMisspellingsAfterTypingToWord");
- VisibleSelection adjacentWords = createVisibleSelectionDeprecated(
- startOfWord(wordStart, LeftWordIfOnBoundary),
- endOfWord(wordStart, RightWordIfOnBoundary));
+ VisibleSelection adjacentWords =
+ createVisibleSelection(startOfWord(wordStart, LeftWordIfOnBoundary),
+ endOfWord(wordStart, RightWordIfOnBoundary));
markMisspellingsAndBadGrammar(adjacentWords);
}
@@ -797,8 +796,8 @@ void SpellChecker::replaceMisspelledRange(const String& text) {
markers[0]->endOffset()));
if (markerRange.isNull())
return;
- frame().selection().setSelection(
- createVisibleSelectionDeprecated(markerRange), CharacterGranularity);
+ frame().selection().setSelection(createVisibleSelection(markerRange),
+ CharacterGranularity);
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
@@ -866,9 +865,9 @@ void SpellChecker::respondToChangedSelection(
frame().settings() && frame().settings()->caretBrowsingEnabled();
if (newSelection.isContentEditable() || caretBrowsing) {
const VisiblePosition newStart(newSelection.visibleStart());
- newAdjacentWords = createVisibleSelectionDeprecated(
- startOfWord(newStart, LeftWordIfOnBoundary),
- endOfWord(newStart, RightWordIfOnBoundary));
+ newAdjacentWords =
+ createVisibleSelection(startOfWord(newStart, LeftWordIfOnBoundary),
+ endOfWord(newStart, RightWordIfOnBoundary));
}
}
@@ -925,9 +924,9 @@ void SpellChecker::spellCheckOldSelection(
TRACE_EVENT0("blink", "SpellChecker::spellCheckOldSelection");
VisiblePosition oldStart(oldSelection.visibleStart());
- VisibleSelection oldAdjacentWords = createVisibleSelectionDeprecated(
- startOfWord(oldStart, LeftWordIfOnBoundary),
- endOfWord(oldStart, RightWordIfOnBoundary));
+ VisibleSelection oldAdjacentWords =
+ createVisibleSelection(startOfWord(oldStart, LeftWordIfOnBoundary),
+ endOfWord(oldStart, RightWordIfOnBoundary));
if (oldAdjacentWords == newAdjacentWords)
return;
markMisspellingsAndBadGrammar(oldAdjacentWords);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698