Chromium Code Reviews| 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) |