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
reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 8 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // Markers of the same type do not overlap each other. | 193 // Markers of the same type do not overlap each other. |
194 | 194 |
195 void DocumentMarkerController::addMarker(Node* node, const DocumentMarker& newMa
rker) | 195 void DocumentMarkerController::addMarker(Node* node, const DocumentMarker& newMa
rker) |
196 { | 196 { |
197 ASSERT(newMarker.endOffset() >= newMarker.startOffset()); | 197 ASSERT(newMarker.endOffset() >= newMarker.startOffset()); |
198 if (newMarker.endOffset() == newMarker.startOffset()) | 198 if (newMarker.endOffset() == newMarker.startOffset()) |
199 return; | 199 return; |
200 | 200 |
201 m_possiblyExistingMarkerTypes.add(newMarker.type()); | 201 m_possiblyExistingMarkerTypes.add(newMarker.type()); |
202 | 202 |
203 OwnPtr<MarkerLists>& markers = m_markers.add(node, nullptr).iterator->value; | 203 OwnPtr<MarkerLists>& markers = m_markers.add(node, nullptr).storedValue->val
ue; |
204 if (!markers) { | 204 if (!markers) { |
205 markers = adoptPtr(new MarkerLists); | 205 markers = adoptPtr(new MarkerLists); |
206 markers->grow(DocumentMarker::MarkerTypeIndexesCount); | 206 markers->grow(DocumentMarker::MarkerTypeIndexesCount); |
207 } | 207 } |
208 | 208 |
209 DocumentMarker::MarkerTypeIndex markerListIndex = MarkerTypeToMarkerIndex(ne
wMarker.type()); | 209 DocumentMarker::MarkerTypeIndex markerListIndex = MarkerTypeToMarkerIndex(ne
wMarker.type()); |
210 if (!markers->at(markerListIndex)) { | 210 if (!markers->at(markerListIndex)) { |
211 markers->insert(markerListIndex, adoptPtr(new MarkerList)); | 211 markers->insert(markerListIndex, adoptPtr(new MarkerList)); |
212 } | 212 } |
213 | 213 |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 | 735 |
736 } // namespace WebCore | 736 } // namespace WebCore |
737 | 737 |
738 #ifndef NDEBUG | 738 #ifndef NDEBUG |
739 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) | 739 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) |
740 { | 740 { |
741 if (controller) | 741 if (controller) |
742 controller->showMarkers(); | 742 controller->showMarkers(); |
743 } | 743 } |
744 #endif | 744 #endif |
OLD | NEW |