| Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
|
| index 15e67cb4b31a065da253ce897e6a2f032f53c138..a65f41ca4bef356f5f583e42fe10074bb3e52402 100644
|
| --- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.cpp
|
| @@ -166,6 +166,26 @@ bool DocumentMarkerListEditor::ShiftMarkersContentIndependent(
|
| return did_shift_marker;
|
| }
|
|
|
| +DocumentMarker* DocumentMarkerListEditor::FirstMarkerIntersectingRange(
|
| + const MarkerList& list,
|
| + unsigned start_offset,
|
| + unsigned end_offset) {
|
| + DCHECK_LE(start_offset, end_offset);
|
| +
|
| + const auto& marker_it =
|
| + std::lower_bound(list.begin(), list.end(), start_offset,
|
| + [](const DocumentMarker* marker, unsigned start_offset) {
|
| + return marker->EndOffset() <= start_offset;
|
| + });
|
| + if (marker_it == list.end())
|
| + return nullptr;
|
| +
|
| + DocumentMarker* marker = *marker_it;
|
| + if (marker->StartOffset() >= end_offset)
|
| + return nullptr;
|
| + return marker;
|
| +}
|
| +
|
| HeapVector<Member<DocumentMarker>>
|
| DocumentMarkerListEditor::MarkersIntersectingRange(const MarkerList& list,
|
| unsigned start_offset,
|
|
|