| 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 bd6fad960936c59028da2e15856885b717236563..fadc5589c455c3d52914c97327959907893f469d 100644
|
| --- a/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp
|
| @@ -305,9 +305,8 @@ void SpellChecker::AdvanceToNextMisspelling(bool start_before_selection) {
|
| .Build());
|
| GetFrame().Selection().RevealSelection();
|
| GetSpellCheckerClient().UpdateSpellingUIWithMisspelledWord(misspelled_word);
|
| - GetFrame().GetDocument()->Markers().AddMarker(
|
| - misspelling_range.StartPosition(), misspelling_range.EndPosition(),
|
| - DocumentMarker::kSpelling);
|
| + GetFrame().GetDocument()->Markers().AddSpellingMarker(
|
| + misspelling_range.StartPosition(), misspelling_range.EndPosition());
|
| }
|
| }
|
|
|
| @@ -539,6 +538,8 @@ static void AddMarker(Document* document,
|
| int location,
|
| int length,
|
| const String& description) {
|
| + DCHECK(type == DocumentMarker::kSpelling || type == DocumentMarker::kGrammar)
|
| + << type;
|
| DCHECK_GT(length, 0);
|
| DCHECK_GE(location, 0);
|
| const EphemeralRange& range_to_mark =
|
| @@ -547,8 +548,17 @@ static void AddMarker(Document* document,
|
| return;
|
| if (!SpellChecker::IsSpellCheckingEnabledAt(range_to_mark.EndPosition()))
|
| return;
|
| - document->Markers().AddMarker(range_to_mark.StartPosition(),
|
| - range_to_mark.EndPosition(), type, description);
|
| +
|
| + if (type == DocumentMarker::kSpelling) {
|
| + document->Markers().AddSpellingMarker(range_to_mark.StartPosition(),
|
| + range_to_mark.EndPosition(),
|
| + description);
|
| + return;
|
| + }
|
| +
|
| + DCHECK_EQ(type, DocumentMarker::kGrammar);
|
| + document->Markers().AddGrammarMarker(
|
| + range_to_mark.StartPosition(), range_to_mark.EndPosition(), description);
|
| }
|
|
|
| void SpellChecker::MarkAndReplaceFor(
|
|
|