| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 m_markers.remove(node); | 364 m_markers.remove(node); |
| 365 if (m_markers.isEmpty()) | 365 if (m_markers.isEmpty()) |
| 366 m_possiblyExistingMarkerTypes = 0; | 366 m_possiblyExistingMarkerTypes = 0; |
| 367 } | 367 } |
| 368 | 368 |
| 369 // repaint the affected node | 369 // repaint the affected node |
| 370 if (docDirty && node->renderer()) | 370 if (docDirty && node->renderer()) |
| 371 node->renderer()->repaint(); | 371 node->renderer()->repaint(); |
| 372 } | 372 } |
| 373 | 373 |
| 374 void DocumentMarkerController::clearWeakMembers(Visitor* visitor) |
| 375 { |
| 376 Vector<const Node*> deadNodes; |
| 377 for (MarkerMap::iterator it = m_markers.begin(); it != m_markers.end(); ++it
) { |
| 378 if (!visitor->isAlive(it->key)) |
| 379 deadNodes.append(it->key); |
| 380 } |
| 381 for (unsigned i = 0; i < deadNodes.size(); ++i) |
| 382 removeMarkers(const_cast<Node*>(deadNodes[i])); |
| 383 } |
| 384 |
| 374 DocumentMarker* DocumentMarkerController::markerContainingPoint(const LayoutPoin
t& point, DocumentMarker::MarkerType markerType) | 385 DocumentMarker* DocumentMarkerController::markerContainingPoint(const LayoutPoin
t& point, DocumentMarker::MarkerType markerType) |
| 375 { | 386 { |
| 376 if (!possiblyHasMarkers(markerType)) | 387 if (!possiblyHasMarkers(markerType)) |
| 377 return 0; | 388 return 0; |
| 378 ASSERT(!(m_markers.isEmpty())); | 389 ASSERT(!(m_markers.isEmpty())); |
| 379 | 390 |
| 380 // outer loop: process each node that contains any markers | 391 // outer loop: process each node that contains any markers |
| 381 MarkerMap::iterator end = m_markers.end(); | 392 MarkerMap::iterator end = m_markers.end(); |
| 382 for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != e
nd; ++nodeIterator) { | 393 for (MarkerMap::iterator nodeIterator = m_markers.begin(); nodeIterator != e
nd; ++nodeIterator) { |
| 383 // inner loop; process each marker in this node | 394 // inner loop; process each marker in this node |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 | 746 |
| 736 } // namespace WebCore | 747 } // namespace WebCore |
| 737 | 748 |
| 738 #ifndef NDEBUG | 749 #ifndef NDEBUG |
| 739 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) | 750 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) |
| 740 { | 751 { |
| 741 if (controller) | 752 if (controller) |
| 742 controller->showMarkers(); | 753 controller->showMarkers(); |
| 743 } | 754 } |
| 744 #endif | 755 #endif |
| OLD | NEW |