Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 7 * reserved. | 7 * reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 391 | 391 |
| 392 const HeapVector<Member<DocumentMarker>>& results = | 392 const HeapVector<Member<DocumentMarker>>& results = |
| 393 list->MarkersIntersectingRange(offset, offset); | 393 list->MarkersIntersectingRange(offset, offset); |
| 394 if (!results.IsEmpty()) | 394 if (!results.IsEmpty()) |
| 395 return results.front(); | 395 return results.front(); |
| 396 } | 396 } |
| 397 | 397 |
| 398 return nullptr; | 398 return nullptr; |
| 399 } | 399 } |
| 400 | 400 |
| 401 DocumentMarker* DocumentMarkerController::FirstMarkerIntersectingOffsetRange( | |
| 402 const Text& node, | |
| 403 unsigned start_offset, | |
| 404 unsigned end_offset, | |
| 405 DocumentMarker::MarkerTypes types) { | |
| 406 if (!PossiblyHasMarkers(types)) | |
| 407 return nullptr; | |
| 408 | |
| 409 MarkerLists* const markers = markers_.at(&node); | |
| 410 if (!markers) | |
| 411 return nullptr; | |
| 412 | |
| 413 for (DocumentMarker::MarkerType type : types) { | |
| 414 const DocumentMarkerList* const list = ListForType(markers, type); | |
| 415 if (!list) | |
| 416 continue; | |
| 417 | |
| 418 const DocumentMarkerVector& markers_from_this_list = | |
| 419 list->MarkersIntersectingRange(start_offset, end_offset); | |
|
yosin_UTC9
2017/07/20 01:07:01
We should have DocumentMarjerList::FirstMarkerInte
| |
| 420 if (!markers_from_this_list.IsEmpty()) | |
| 421 return markers_from_this_list.front(); | |
| 422 } | |
| 423 | |
| 424 return nullptr; | |
| 425 } | |
| 426 | |
| 401 DocumentMarkerVector DocumentMarkerController::MarkersFor( | 427 DocumentMarkerVector DocumentMarkerController::MarkersFor( |
| 402 Node* node, | 428 Node* node, |
| 403 DocumentMarker::MarkerTypes marker_types) { | 429 DocumentMarker::MarkerTypes marker_types) { |
| 404 DocumentMarkerVector result; | 430 DocumentMarkerVector result; |
| 405 if (!PossiblyHasMarkers(marker_types)) | 431 if (!PossiblyHasMarkers(marker_types)) |
| 406 return result; | 432 return result; |
| 407 | 433 |
| 408 MarkerLists* markers = markers_.at(node); | 434 MarkerLists* markers = markers_.at(node); |
| 409 if (!markers) | 435 if (!markers) |
| 410 return result; | 436 return result; |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 754 } | 780 } |
| 755 | 781 |
| 756 } // namespace blink | 782 } // namespace blink |
| 757 | 783 |
| 758 #ifndef NDEBUG | 784 #ifndef NDEBUG |
| 759 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { | 785 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { |
| 760 if (controller) | 786 if (controller) |
| 761 controller->ShowMarkers(); | 787 controller->ShowMarkers(); |
| 762 } | 788 } |
| 763 #endif | 789 #endif |
| OLD | NEW |