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 5ced5f51e552afcf9632cbe705ffc64ad2f121cd..35ef14b21c14ffb28c171fb77e0e2354c2b99608 100644 |
| --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
| +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp |
| @@ -794,9 +794,8 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio |
| if (!isSpellCheckingEnabledFor(oldSelection)) |
| return; |
| - bool closeTyping = options & FrameSelection::CloseTyping; |
| - bool isContinuousSpellCheckingEnabled = this->isContinuousSpellCheckingEnabled(); |
| - bool isContinuousGrammarCheckingEnabled = isContinuousSpellCheckingEnabled; |
| + const bool closeTyping = options & FrameSelection::CloseTyping; |
| + const bool isContinuousSpellCheckingEnabled = this->isContinuousSpellCheckingEnabled(); |
| if (isContinuousSpellCheckingEnabled && closeTyping && shouldCheckOldSelection(oldSelection)) { |
| VisibleSelection newAdjacentWords; |
| bool caretBrowsing = frame().settings() && frame().settings()->caretBrowsingEnabled(); |
| @@ -821,10 +820,10 @@ void SpellChecker::respondToChangedSelection(const VisibleSelection& oldSelectio |
| } |
| // When continuous spell checking is off, existing markers disappear after the selection changes. |
| - if (!isContinuousSpellCheckingEnabled) |
| + if (!isContinuousSpellCheckingEnabled) { |
|
yosin_UTC9
2016/06/30 03:49:44
We prefer early return.
When |isContinuousSpellCh
yoichio
2016/06/30 05:51:47
Done.
|
| frame().document()->markers().removeMarkers(DocumentMarker::Spelling); |
| - if (!isContinuousGrammarCheckingEnabled) |
| frame().document()->markers().removeMarkers(DocumentMarker::Grammar); |
| + } |
| } |
| void SpellChecker::removeSpellingMarkers() |