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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 unsigned startOffset = textPiece->startOffset(); | 107 unsigned startOffset = textPiece->startOffset(); |
108 unsigned endOffset = textPiece->endOffset(); | 108 unsigned endOffset = textPiece->endOffset(); |
109 addMarker(textPiece->startContainer(), DocumentMarker(startOffset, endOf
fset, activeMatch)); | 109 addMarker(textPiece->startContainer(), DocumentMarker(startOffset, endOf
fset, activeMatch)); |
110 if (endOffset > startOffset) { | 110 if (endOffset > startOffset) { |
111 // Rendered rects for markers in WebKit are not populated until each
time | 111 // Rendered rects for markers in WebKit are not populated until each
time |
112 // the markers are painted. However, we need it to happen sooner, be
cause | 112 // the markers are painted. However, we need it to happen sooner, be
cause |
113 // the whole purpose of tickmarks on the scrollbar is to show where | 113 // the whole purpose of tickmarks on the scrollbar is to show where |
114 // matches off-screen are (that haven't been painted yet). | 114 // matches off-screen are (that haven't been painted yet). |
115 Node* node = textPiece->startContainer(); | 115 Node* node = textPiece->startContainer(); |
116 Vector<DocumentMarker*> markers = markersFor(node); | 116 Vector<DocumentMarker*> markers = markersFor(node); |
117 static_cast<RenderedDocumentMarker*>(markers[markers.size() - 1])->s
etRenderedRect(range->boundingBox()); | 117 toRenderedDocumentMarker(markers[markers.size() - 1])->setRenderedRe
ct(range->boundingBox()); |
118 } | 118 } |
119 } | 119 } |
120 } | 120 } |
121 | 121 |
122 void DocumentMarkerController::removeMarkers(Range* range, DocumentMarker::Marke
rTypes markerTypes, RemovePartiallyOverlappingMarkerOrNot shouldRemovePartiallyO
verlappingMarker) | 122 void DocumentMarkerController::removeMarkers(Range* range, DocumentMarker::Marke
rTypes markerTypes, RemovePartiallyOverlappingMarkerOrNot shouldRemovePartiallyO
verlappingMarker) |
123 { | 123 { |
124 for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance
()) { | 124 for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance
()) { |
125 if (!possiblyHasMarkers(markerTypes)) | 125 if (!possiblyHasMarkers(markerTypes)) |
126 return; | 126 return; |
127 ASSERT(!m_markers.isEmpty()); | 127 ASSERT(!m_markers.isEmpty()); |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 | 656 |
657 } // namespace WebCore | 657 } // namespace WebCore |
658 | 658 |
659 #ifndef NDEBUG | 659 #ifndef NDEBUG |
660 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) | 660 void showDocumentMarkers(const WebCore::DocumentMarkerController* controller) |
661 { | 661 { |
662 if (controller) | 662 if (controller) |
663 controller->showMarkers(); | 663 controller->showMarkers(); |
664 } | 664 } |
665 #endif | 665 #endif |
OLD | NEW |