| 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
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights |
| 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) |
| 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 9 * | 11 * |
| 10 * This library is free software; you can redistribute it and/or | 12 * This library is free software; you can redistribute it and/or |
| 11 * modify it under the terms of the GNU Library General Public | 13 * modify it under the terms of the GNU Library General Public |
| 12 * License as published by the Free Software Foundation; either | 14 * License as published by the Free Software Foundation; either |
| 13 * version 2 of the License, or (at your option) any later version. | 15 * version 2 of the License, or (at your option) any later version. |
| 14 * | 16 * |
| 15 * This library is distributed in the hope that it will be useful, | 17 * This library is distributed in the hope that it will be useful, |
| 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool thick, | 75 bool thick, |
| 74 Color backgroundColor); | 76 Color backgroundColor); |
| 75 | 77 |
| 76 void copyMarkers(Node* srcNode, | 78 void copyMarkers(Node* srcNode, |
| 77 unsigned startOffset, | 79 unsigned startOffset, |
| 78 int length, | 80 int length, |
| 79 Node* dstNode, | 81 Node* dstNode, |
| 80 int delta); | 82 int delta); |
| 81 | 83 |
| 82 void prepareForDestruction(); | 84 void prepareForDestruction(); |
| 83 // When a marker partially overlaps with range, if removePartiallyOverlappingM
arkers is true, we completely | 85 // When a marker partially overlaps with range, if |
| 84 // remove the marker. If the argument is false, we will adjust the span of the
marker so that it retains | 86 // removePartiallyOverlappingMarkers is true, we completely remove the marker. |
| 85 // the portion that is outside of the range. | 87 // If the argument is false, we will adjust the span of the marker so that it |
| 88 // retains the portion that is outside of the range. |
| 86 enum RemovePartiallyOverlappingMarkerOrNot { | 89 enum RemovePartiallyOverlappingMarkerOrNot { |
| 87 DoNotRemovePartiallyOverlappingMarker, | 90 DoNotRemovePartiallyOverlappingMarker, |
| 88 RemovePartiallyOverlappingMarker | 91 RemovePartiallyOverlappingMarker |
| 89 }; | 92 }; |
| 90 void removeMarkers(const EphemeralRange&, | 93 void removeMarkers(const EphemeralRange&, |
| 91 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers(), | 94 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers(), |
| 92 RemovePartiallyOverlappingMarkerOrNot = | 95 RemovePartiallyOverlappingMarkerOrNot = |
| 93 DoNotRemovePartiallyOverlappingMarker); | 96 DoNotRemovePartiallyOverlappingMarker); |
| 94 void removeMarkers(Node*, | 97 void removeMarkers(Node*, |
| 95 unsigned startOffset, | 98 unsigned startOffset, |
| 96 int length, | 99 int length, |
| 97 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers(), | 100 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers(), |
| 98 RemovePartiallyOverlappingMarkerOrNot = | 101 RemovePartiallyOverlappingMarkerOrNot = |
| 99 DoNotRemovePartiallyOverlappingMarker); | 102 DoNotRemovePartiallyOverlappingMarker); |
| 100 | 103 |
| 101 void removeMarkers( | 104 void removeMarkers( |
| 102 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 105 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| 103 void removeMarkers( | 106 void removeMarkers( |
| 104 Node*, | 107 Node*, |
| 105 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 108 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| 106 void removeMarkers(const MarkerRemoverPredicate& shouldRemoveMarker); | 109 void removeMarkers(const MarkerRemoverPredicate& shouldRemoveMarker); |
| 107 void repaintMarkers( | 110 void repaintMarkers( |
| 108 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 111 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| 109 void shiftMarkers(Node*, unsigned startOffset, int delta); | 112 void shiftMarkers(Node*, unsigned startOffset, int delta); |
| 110 // Returns true if markers within a range are found. | 113 // Returns true if markers within a range are found. |
| 111 bool setMarkersActive(const EphemeralRange&, bool); | 114 bool setMarkersActive(const EphemeralRange&, bool); |
| 112 // Returns true if markers within a range defined by a node, |startOffset| and
|endOffset| are found. | 115 // Returns true if markers within a range defined by a node, |startOffset| and |
| 116 // |endOffset| are found. |
| 113 bool setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool); | 117 bool setMarkersActive(Node*, unsigned startOffset, unsigned endOffset, bool); |
| 114 bool hasMarkers(Node* node) const { return m_markers.contains(node); } | 118 bool hasMarkers(Node* node) const { return m_markers.contains(node); } |
| 115 | 119 |
| 116 DocumentMarkerVector markersFor( | 120 DocumentMarkerVector markersFor( |
| 117 Node*, | 121 Node*, |
| 118 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); | 122 DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
| 119 DocumentMarkerVector markersInRange(const EphemeralRange&, | 123 DocumentMarkerVector markersInRange(const EphemeralRange&, |
| 120 DocumentMarker::MarkerTypes); | 124 DocumentMarker::MarkerTypes); |
| 121 DocumentMarkerVector markers(); | 125 DocumentMarkerVector markers(); |
| 122 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType); | 126 Vector<IntRect> renderedRectsForMarkers(DocumentMarker::MarkerType); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 138 HeapVector<Member<MarkerList>, DocumentMarker::MarkerTypeIndexesCount>; | 142 HeapVector<Member<MarkerList>, DocumentMarker::MarkerTypeIndexesCount>; |
| 139 using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>; | 143 using MarkerMap = HeapHashMap<WeakMember<const Node>, Member<MarkerLists>>; |
| 140 void mergeOverlapping(MarkerList*, RenderedDocumentMarker*); | 144 void mergeOverlapping(MarkerList*, RenderedDocumentMarker*); |
| 141 bool possiblyHasMarkers(DocumentMarker::MarkerTypes); | 145 bool possiblyHasMarkers(DocumentMarker::MarkerTypes); |
| 142 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); | 146 void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes); |
| 143 void removeMarkers(TextIterator&, | 147 void removeMarkers(TextIterator&, |
| 144 DocumentMarker::MarkerTypes, | 148 DocumentMarker::MarkerTypes, |
| 145 RemovePartiallyOverlappingMarkerOrNot); | 149 RemovePartiallyOverlappingMarkerOrNot); |
| 146 | 150 |
| 147 MarkerMap m_markers; | 151 MarkerMap m_markers; |
| 148 // Provide a quick way to determine whether a particular marker type is absent
without going through the map. | 152 // Provide a quick way to determine whether a particular marker type is absent |
| 153 // without going through the map. |
| 149 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes; | 154 DocumentMarker::MarkerTypes m_possiblyExistingMarkerTypes; |
| 150 const Member<const Document> m_document; | 155 const Member<const Document> m_document; |
| 151 }; | 156 }; |
| 152 | 157 |
| 153 } // namespace blink | 158 } // namespace blink |
| 154 | 159 |
| 155 #ifndef NDEBUG | 160 #ifndef NDEBUG |
| 156 void showDocumentMarkers(const blink::DocumentMarkerController*); | 161 void showDocumentMarkers(const blink::DocumentMarkerController*); |
| 157 #endif | 162 #endif |
| 158 | 163 |
| 159 #endif // DocumentMarkerController_h | 164 #endif // DocumentMarkerController_h |
| OLD | NEW |