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 a9309fae840172d93c5b50057c0fa4918ed1b977..32ef9a8cbc1664e5ca4bebcb4b74bb690faae968 100644 |
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp |
@@ -383,14 +383,16 @@ DocumentMarkerVector DocumentMarkerController::MarkersFor( |
Node* node, |
DocumentMarker::MarkerTypes marker_types) { |
DocumentMarkerVector result; |
+ if (!PossiblyHasMarkers(marker_types)) |
+ return result; |
MarkerLists* markers = markers_.at(node); |
if (!markers) |
return result; |
- for (DocumentMarker::MarkerType type : DocumentMarker::AllMarkers()) { |
+ for (DocumentMarker::MarkerType type : marker_types) { |
DocumentMarkerList* const list = ListForType(markers, type); |
- if (!list || list->IsEmpty() || !marker_types.Contains(type)) |
+ if (!list || list->IsEmpty()) |
continue; |
result.AppendVector(list->GetMarkers()); |