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

Unified Diff: third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Issue 2198223003: Remove grammar checking from SpellChecker::markMisspellingsAndBadGrammar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PurgeMarkAllInRanges2
Patch Set: Created 4 years, 4 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 | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 868767f5ed5246047ae20a8465fe5b89faa4106c..d2761410b19984344d9c9ca140bf10ecf5924609 100644
--- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
+++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
@@ -337,7 +337,16 @@ void SpellChecker::clearMisspellingsAndBadGrammar(const VisibleSelection &moving
void SpellChecker::markMisspellingsAndBadGrammar(const VisibleSelection &movingSelection)
{
- markMisspellingsAndBadGrammar(movingSelection, isContinuousSpellCheckingEnabled(), movingSelection);
+ if (unifiedTextCheckerEnabled()) {
+ if (!isContinuousSpellCheckingEnabled())
+ return;
+
+ // markMisspellingsAndBadGrammar() is triggered by selection change, in which case we check spelling, but don't autocorrect misspellings.
yosin_UTC9 2016/08/02 07:38:15 OPTIONAL: Could you format comments in 80 chars pe
Xiaocheng 2016/08/02 07:40:00 All right. I'll do it in the next patch.
+ markAllMisspellingsInRange(movingSelection.toNormalizedEphemeralRange());
+ return;
+ }
+
+ markMisspellings(movingSelection);
}
void SpellChecker::markMisspellingsAfterLineBreak(const VisibleSelection& wordSelection)
@@ -627,20 +636,6 @@ void SpellChecker::markAndReplaceFor(SpellCheckRequest* request, const Vector<Te
}
}
-void SpellChecker::markMisspellingsAndBadGrammar(const VisibleSelection& spellingSelection, bool markGrammar, const VisibleSelection& grammarSelection)
-{
- if (unifiedTextCheckerEnabled()) {
- if (!isContinuousSpellCheckingEnabled())
- return;
-
- // markMisspellingsAndBadGrammar() is triggered by selection change, in which case we check spelling and grammar, but don't autocorrect misspellings.
- markAllMisspellingsInRange(spellingSelection.toNormalizedEphemeralRange());
- return;
- }
-
- markMisspellings(spellingSelection);
-}
-
void SpellChecker::updateMarkersForWordsAffectedByEditing(bool doNotRemoveIfSelectionAtWordBoundary)
{
DCHECK(frame().selection().isAvailable());
@@ -842,12 +837,7 @@ void SpellChecker::spellCheckOldSelection(const VisibleSelection& oldSelection,
VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
if (oldAdjacentWords == newAdjacentWords)
return;
- if (isContinuousSpellCheckingEnabled()) {
- VisibleSelection selectedSentence = VisibleSelection(startOfSentence(oldStart), endOfSentence(oldStart));
- markMisspellingsAndBadGrammar(oldAdjacentWords, true, selectedSentence);
- return;
- }
- markMisspellingsAndBadGrammar(oldAdjacentWords, false, oldAdjacentWords);
+ markMisspellingsAndBadGrammar(oldAdjacentWords);
}
static Node* findFirstMarkable(Node* node)
« no previous file with comments | « third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698