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 9c58d8f68325e7940349f484924c3df399a00396..c4ac4a97857c7bbaf3599d5e99d55040bf1bce74 100644 |
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
@@ -62,10 +62,14 @@ 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) |
+ << type; |
// Use a TextIterator to visit the potentially multiple nodes the range |
// covers. |
for (TextIterator markedText(start, end); !markedText.atEnd(); |
@@ -77,6 +81,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()); |