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 bd4b4a333a27266543f56f325565cee56c7b1981..15f729fd3f232cb275c80d8ca6a1a1198b3ad0e2 100644 |
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
@@ -644,7 +644,8 @@ void SpellChecker::markAndReplaceFor( |
// TODO(xiaochengh): The following comment does not match the current |
// behavior and should be rewritten. |
// Attempt to save the caret position so we can restore it later if needed |
- const Position& caretPosition = frame().selection().end(); |
+ const Position& caretPosition = |
+ frame().selection().computeVisibleSelectionInDOMTreeDeprecated().end(); |
selectionOffset = paragraph.offsetTo(caretPosition); |
if (selectionOffset > 0 && |
static_cast<unsigned>(selectionOffset) <= paragraph.text().length() && |