Index: Source/core/dom/DocumentMarkerController.cpp |
diff --git a/Source/core/dom/DocumentMarkerController.cpp b/Source/core/dom/DocumentMarkerController.cpp |
index 354d82a857fc1499f6d60a36896db5202f0f5dd0..bf9103837e5643a5081338314b93696310487250 100644 |
--- a/Source/core/dom/DocumentMarkerController.cpp |
+++ b/Source/core/dom/DocumentMarkerController.cpp |
@@ -119,6 +119,22 @@ void DocumentMarkerController::addMarker(Range* range, DocumentMarker::MarkerTyp |
} |
+void DocumentMarkerController::addMarker(const Position& start, const Position& end, DocumentMarker::MarkerType type, const String& description) |
+{ |
+ // Use a TextIterator to visit the potentially multiple nodes the range covers. |
+ for (TextIterator markedText(start, end); !markedText.atEnd(); markedText.advance()) { |
+ addMarker(markedText.startContainer(), DocumentMarker(type, markedText.startOffset(), markedText.endOffset(), description)); |
+ } |
+} |
+ |
+void DocumentMarkerController::addMarker(const Position& start, const Position& end, DocumentMarker::MarkerType type) |
+{ |
+ // Use a TextIterator to visit the potentially multiple nodes the range covers. |
+ for (TextIterator markedText(start, end); !markedText.atEnd(); markedText.advance()) { |
+ addMarker(markedText.startContainer(), DocumentMarker(type, markedText.startOffset(), markedText.endOffset())); |
yosin_UTC9
2014/09/18 01:08:51
nit: It seems ctor of |DocumentMarker| check |desc
Mads Ager (chromium)
2014/09/18 06:58:49
Thanks, that is true. Looks like this can be simpl
|
+ } |
+} |
+ |
void DocumentMarkerController::addTextMatchMarker(const Range* range, bool activeMatch) |
{ |
// Use a TextIterator to visit the potentially multiple nodes the range covers. |