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

Unified Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 1620653002: Pass Only the Pasted Text to Spellchecker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/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)

Powered by Google App Engine
This is Rietveld 408576698