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

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

Issue 2430253003: Get rid of createVisibleSelection() to take EphemeralRange (Closed)
Patch Set: 2016-10-20T14:03:19 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
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 36a46a159e260952460b45896a45532eae905477..1f432b573a035a03b69f3907c491d1e92ffe5de9 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -333,7 +333,9 @@ void SpellChecker::advanceToNextMisspelling(bool startBeforeSelection) {
const EphemeralRange misspellingRange = calculateCharacterSubrange(
EphemeralRange(spellingSearchStart, spellingSearchEnd),
misspellingOffset, misspelledWord.length());
- frame().selection().setSelection(createVisibleSelection(misspellingRange));
+ frame().selection().setSelection(SelectionInDOMTree::Builder()
+ .setBaseAndExtent(misspellingRange)
+ .build());
frame().selection().revealSelection();
spellCheckerClient().updateSpellingUIWithMisspelledWord(misspelledWord);
frame().document()->markers().addMarker(misspellingRange.startPosition(),
@@ -802,8 +804,8 @@ void SpellChecker::replaceMisspelledRange(const String& text) {
markers[0]->endOffset()));
if (markerRange.isNull())
return;
- frame().selection().setSelection(createVisibleSelection(markerRange),
- CharacterGranularity);
+ frame().selection().setSelection(
+ SelectionInDOMTree::Builder().setBaseAndExtent(markerRange).build());
// TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
// needs to be audited. See http://crbug.com/590369 for more details.
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleSelection.cpp ('k') | third_party/WebKit/Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698