Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/Editor.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp |
| index a84363f25882ba3ac78ca7e62a3d5de8f68149c6..b3e7f4095aef0a4af1460635e35838d88dfd8c0f 100644 |
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp |
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp |
| @@ -512,7 +512,11 @@ void Editor::replaceSelectionWithFragment(PassRefPtrWillBeRawPtr<DocumentFragmen |
| if (frame().selection().isInPasswordField() || !spellChecker().isContinuousSpellCheckingEnabled()) |
| return; |
| - spellChecker().chunkAndMarkAllMisspellingsAndBadGrammar(frame().selection().rootEditableElement()); |
| + |
| + ASSERT(lastEditCommand()->isReplaceSelectionCommand()); |
| + const EphemeralRange& insertedRange = toReplaceSelectionCommand(lastEditCommand())->insertedRange(); |
| + if (insertedRange.isNotNull()) |
|
yosin_UTC9
2016/01/22 09:56:55
nit: early return style is better.
Xiaocheng
2016/01/22 10:24:37
Done.
|
| + spellChecker().chunkAndMarkAllMisspellingsAndBadGrammar(frame().selection().rootEditableElement(), insertedRange); |
| } |
| void Editor::replaceSelectionWithText(const String& text, bool selectReplacement, bool smartReplace) |