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

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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6ac01cdf4159227f26899b2694297968b60a8101 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.isNull())
+ return;
+ spellChecker().chunkAndMarkAllMisspellingsAndBadGrammar(frame().selection().rootEditableElement(), insertedRange);
}
void Editor::replaceSelectionWithText(const String& text, bool selectReplacement, bool smartReplace)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698