Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
| index 4d74ac886e419d8dddf290df278481316084ceac..177d4309eb9b36ce63d0ab9a69f79980e1063317 100644 |
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
| @@ -62,10 +62,13 @@ void DocumentMarkerController::clear() { |
| } |
| } |
| -void DocumentMarkerController::addMarker(const Position& start, |
| - const Position& end, |
| - DocumentMarker::MarkerType type, |
| - const String& description) { |
| +void DocumentMarkerController::addGrammarOrSpellingMarker( |
| + const Position& start, |
| + const Position& end, |
| + DocumentMarker::MarkerType type, |
| + const String& description) { |
| + DCHECK(!m_document->needsLayoutTreeUpdate()); |
| + DCHECK(type == DocumentMarker::Grammar || type == DocumentMarker::Spelling); |
|
yosin_UTC9
2017/03/30 01:48:57
nit: Could you add |<< type| for ease of debugging
|
| // Use a TextIterator to visit the potentially multiple nodes the range |
| // covers. |
| for (TextIterator markedText(start, end); !markedText.atEnd(); |
| @@ -77,6 +80,18 @@ void DocumentMarkerController::addMarker(const Position& start, |
| } |
| } |
| +void DocumentMarkerController::addSpellingMarker(const Position& start, |
| + const Position& end, |
| + const String& description) { |
| + addGrammarOrSpellingMarker(start, end, DocumentMarker::Spelling, description); |
| +} |
| + |
| +void DocumentMarkerController::addGrammarMarker(const Position& start, |
| + const Position& end, |
| + const String& description) { |
| + addGrammarOrSpellingMarker(start, end, DocumentMarker::Grammar, description); |
| +} |
| + |
| void DocumentMarkerController::addTextMatchMarker(const EphemeralRange& range, |
| bool activeMatch) { |
| DCHECK(!m_document->needsLayoutTreeUpdate()); |