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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 bool SetTextMatchMarkersActive(Node*, | 87 bool SetTextMatchMarkersActive(Node*, |
| 88 unsigned start_offset, | 88 unsigned start_offset, |
| 89 unsigned end_offset, | 89 unsigned end_offset, |
| 90 bool); | 90 bool); |
| 91 bool HasMarkers(Node* node) const { return markers_.Contains(node); } | 91 bool HasMarkers(Node* node) const { return markers_.Contains(node); } |
| 92 | 92 |
| 93 // Returns a marker of one of the specified types that includes the specified | 93 // Returns a marker of one of the specified types that includes the specified |
| 94 // Position in its interior (not at an endpoint), if one exists. | 94 // Position in its interior (not at an endpoint), if one exists. |
| 95 DocumentMarker* MarkerAtPosition(const Position&, | 95 DocumentMarker* MarkerAtPosition(const Position&, |
| 96 DocumentMarker::MarkerTypes); | 96 DocumentMarker::MarkerTypes); |
| 97 // Return all markers of the specified types whose interiors have non-empty | |
| 98 // overlap with the range [start_offset, end_offset]. Note that the range can | |
| 99 // be collapsed, in which case markers containing the offset in their | |
| 100 // interiors are returned. | |
| 101 HeapVector<std::pair<Member<Node>, Member<DocumentMarker>>> | |
| 102 MarkersIntersectingRange(const EphemeralRange&, DocumentMarker::MarkerTypes); | |
| 103 HeapVector<std::pair<Member<Node>, Member<DocumentMarker>>> | |
| 104 MarkersIntersectingRange(const EphemeralRangeInFlatTree&, | |
| 105 DocumentMarker::MarkerTypes); | |
| 97 DocumentMarkerVector MarkersFor( | 106 DocumentMarkerVector MarkersFor( |
| 98 Node*, | 107 Node*, |
| 99 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 108 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| 100 DocumentMarkerVector Markers(); | 109 DocumentMarkerVector Markers(); |
| 101 Vector<IntRect> LayoutRectsForTextMatchMarkers(); | 110 Vector<IntRect> LayoutRectsForTextMatchMarkers(); |
| 102 void InvalidateRectsForAllTextMatchMarkers(); | 111 void InvalidateRectsForAllTextMatchMarkers(); |
| 103 void InvalidateRectsForTextMatchMarkersInNode(const Node&); | 112 void InvalidateRectsForTextMatchMarkersInNode(const Node&); |
| 104 | 113 |
| 105 DECLARE_TRACE(); | 114 DECLARE_TRACE(); |
| 106 | 115 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 118 void AddMarkerInternal( | 127 void AddMarkerInternal( |
| 119 const EphemeralRange&, | 128 const EphemeralRange&, |
| 120 std::function<DocumentMarker*(int, int)> create_marker_from_offsets); | 129 std::function<DocumentMarker*(int, int)> create_marker_from_offsets); |
| 121 void AddMarkerToNode(Node*, DocumentMarker*); | 130 void AddMarkerToNode(Node*, DocumentMarker*); |
| 122 | 131 |
| 123 using MarkerLists = HeapVector<Member<DocumentMarkerList>, | 132 using MarkerLists = HeapVector<Member<DocumentMarkerList>, |
| 124 DocumentMarker::kMarkerTypeIndexesCount>; | 133 DocumentMarker::kMarkerTypeIndexesCount>; |
| 125 using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>; | 134 using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>; |
| 126 static Member<DocumentMarkerList>& ListForType(MarkerLists*, | 135 static Member<DocumentMarkerList>& ListForType(MarkerLists*, |
| 127 DocumentMarker::MarkerType); | 136 DocumentMarker::MarkerType); |
| 137 template <typename Strategy> | |
| 138 HeapVector<std::pair<Member<Node>, Member<DocumentMarker>>> | |
| 139 MarkersIntersectingRangeHelper(const EphemeralRangeTemplate<Strategy>&, | |
|
yosin_UTC9
2017/07/05 04:51:36
Can we have flat tree version only?
I think we don
| |
| 140 DocumentMarker::MarkerTypes); | |
| 128 bool PossiblyHasMarkers(DocumentMarker::MarkerTypes); | 141 bool PossiblyHasMarkers(DocumentMarker::MarkerTypes); |
| 129 void RemoveMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); | 142 void RemoveMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); |
| 130 void RemoveMarkers(TextIterator&, DocumentMarker::MarkerTypes); | 143 void RemoveMarkers(TextIterator&, DocumentMarker::MarkerTypes); |
| 131 void RemoveMarkersInternal(Node*, | 144 void RemoveMarkersInternal(Node*, |
| 132 unsigned start_offset, | 145 unsigned start_offset, |
| 133 int length, | 146 int length, |
| 134 DocumentMarker::MarkerTypes); | 147 DocumentMarker::MarkerTypes); |
| 135 | 148 |
| 136 MarkerMap markers_; | 149 MarkerMap markers_; |
| 137 // Provide a quick way to determine whether a particular marker type is absent | 150 // Provide a quick way to determine whether a particular marker type is absent |
| 138 // without going through the map. | 151 // without going through the map. |
| 139 DocumentMarker::MarkerTypes possibly_existing_marker_types_; | 152 DocumentMarker::MarkerTypes possibly_existing_marker_types_; |
| 140 const Member<const Document> document_; | 153 const Member<const Document> document_; |
| 141 }; | 154 }; |
| 142 | 155 |
| 143 } // namespace blink | 156 } // namespace blink |
| 144 | 157 |
| 145 #ifndef NDEBUG | 158 #ifndef NDEBUG |
| 146 void showDocumentMarkers(const blink::DocumentMarkerController*); | 159 void showDocumentMarkers(const blink::DocumentMarkerController*); |
| 147 #endif | 160 #endif |
| 148 | 161 |
| 149 #endif // DocumentMarkerController_h | 162 #endif // DocumentMarkerController_h |
| OLD | NEW |