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 938b032fd42aae60d3aa9c07b6dd559d5c5b1e6e..4f92ee5bdd50c47b23a5fffd9b200b5ee9af0830 100644 |
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
@@ -61,16 +61,15 @@ void DocumentMarkerController::clear() { |
} |
void DocumentMarkerController::addGrammarOrSpellingMarker( |
- const Position& start, |
- const Position& end, |
+ const EphemeralRange& range, |
DocumentMarker::MarkerType type, |
const String& description) { |
DCHECK(!m_document->needsLayoutTreeUpdate()); |
DCHECK(type == DocumentMarker::Grammar || type == DocumentMarker::Spelling); |
// Use a TextIterator to visit the potentially multiple nodes the range |
// covers. |
- for (TextIterator markedText(start, end); !markedText.atEnd(); |
- markedText.advance()) { |
+ for (TextIterator markedText(range.startPosition(), range.endPosition()); |
+ !markedText.atEnd(); markedText.advance()) { |
DocumentMarker* marker; |
if (type == DocumentMarker::Grammar) { |
marker = DocumentMarker::createGrammarMarker( |
@@ -85,16 +84,14 @@ void DocumentMarkerController::addGrammarOrSpellingMarker( |
} |
} |
-void DocumentMarkerController::addSpellingMarker(const Position& start, |
- const Position& end, |
+void DocumentMarkerController::addSpellingMarker(const EphemeralRange& range, |
const String& description) { |
- addGrammarOrSpellingMarker(start, end, DocumentMarker::Spelling, description); |
+ addGrammarOrSpellingMarker(range, DocumentMarker::Spelling, description); |
} |
-void DocumentMarkerController::addGrammarMarker(const Position& start, |
- const Position& end, |
+void DocumentMarkerController::addGrammarMarker(const EphemeralRange& range, |
const String& description) { |
- addGrammarOrSpellingMarker(start, end, DocumentMarker::Grammar, description); |
+ addGrammarOrSpellingMarker(range, DocumentMarker::Grammar, description); |
} |
void DocumentMarkerController::addTextMatchMarker(const EphemeralRange& range, |
@@ -114,15 +111,14 @@ void DocumentMarkerController::addTextMatchMarker(const EphemeralRange& range, |
// throttling algorithm. crbug.com/6819. |
} |
-void DocumentMarkerController::addCompositionMarker(const Position& start, |
- const Position& end, |
+void DocumentMarkerController::addCompositionMarker(const EphemeralRange& range, |
Color underlineColor, |
bool thick, |
Color backgroundColor) { |
DCHECK(!m_document->needsLayoutTreeUpdate()); |
- for (TextIterator markedText(start, end); !markedText.atEnd(); |
- markedText.advance()) { |
+ for (TextIterator markedText(range.startPosition(), range.endPosition()); |
+ !markedText.atEnd(); markedText.advance()) { |
addMarker(markedText.currentContainer(), |
DocumentMarker::createCompositionMarker( |
markedText.startOffsetInCurrentContainer(), |