| 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 32174b63eecb817e2305c8f5980e63edaa9968c7..1e9624648685cc427e3049534186dbf33101a584 100644
|
| --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| @@ -630,8 +630,20 @@ void SpellChecker::markAndReplaceFor(
|
| DocumentLifecycle::DisallowTransitionScope disallowTransition(
|
| frame().document()->lifecycle());
|
|
|
| - TextCheckingParagraph paragraph(request->checkingRange(),
|
| - request->checkingRange());
|
| + EphemeralRange checkingRange(request->checkingRange());
|
| +
|
| + // Abort marking if the content of the checking change has been modified.
|
| + String currentContent =
|
| + plainText(checkingRange,
|
| + TextIteratorBehavior::Builder()
|
| + .setEmitsObjectReplacementCharacter(true)
|
| + .build());
|
| + if (currentContent != request->data().text()) {
|
| + // "editing/spelling/spellcheck-async-mutation.html" reaches here.
|
| + return;
|
| + }
|
| +
|
| + TextCheckingParagraph paragraph(checkingRange, checkingRange);
|
|
|
| // TODO(xiaochengh): The following comment does not match the current behavior
|
| // and should be rewritten.
|
|
|