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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // covers. | 100 // covers. |
101 for (TextIterator markedText(start, end); !markedText.atEnd(); | 101 for (TextIterator markedText(start, end); !markedText.atEnd(); |
102 markedText.advance()) { | 102 markedText.advance()) { |
103 addMarker( | 103 addMarker( |
104 markedText.currentContainer(), | 104 markedText.currentContainer(), |
105 DocumentMarker(type, markedText.startOffsetInCurrentContainer(), | 105 DocumentMarker(type, markedText.startOffsetInCurrentContainer(), |
106 markedText.endOffsetInCurrentContainer(), description)); | 106 markedText.endOffsetInCurrentContainer(), description)); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 void DocumentMarkerController::addTextMatchMarker(const EphemeralRange& range, | 110 void DocumentMarkerController::addTextMatchMarker( |
111 bool activeMatch) { | 111 const EphemeralRange& range, |
| 112 DocumentMarker::MatchStatus matchStatus) { |
112 DCHECK(!m_document->needsLayoutTreeUpdate()); | 113 DCHECK(!m_document->needsLayoutTreeUpdate()); |
113 | 114 |
114 // Use a TextIterator to visit the potentially multiple nodes the range | 115 // Use a TextIterator to visit the potentially multiple nodes the range |
115 // covers. | 116 // covers. |
116 for (TextIterator markedText(range.startPosition(), range.endPosition()); | 117 for (TextIterator markedText(range.startPosition(), range.endPosition()); |
117 !markedText.atEnd(); markedText.advance()) | 118 !markedText.atEnd(); markedText.advance()) { |
118 addMarker( | 119 addMarker( |
119 markedText.currentContainer(), | 120 markedText.currentContainer(), |
120 DocumentMarker(markedText.startOffsetInCurrentContainer(), | 121 DocumentMarker(markedText.startOffsetInCurrentContainer(), |
121 markedText.endOffsetInCurrentContainer(), activeMatch)); | 122 markedText.endOffsetInCurrentContainer(), matchStatus)); |
| 123 } |
122 // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a | 124 // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a |
123 // throttling algorithm. crbug.com/6819. | 125 // throttling algorithm. crbug.com/6819. |
124 } | 126 } |
125 | 127 |
126 void DocumentMarkerController::addCompositionMarker(const Position& start, | 128 void DocumentMarkerController::addCompositionMarker(const Position& start, |
127 const Position& end, | 129 const Position& end, |
128 Color underlineColor, | 130 Color underlineColor, |
129 bool thick, | 131 bool thick, |
130 Color backgroundColor) { | 132 Color backgroundColor) { |
131 DCHECK(!m_document->needsLayoutTreeUpdate()); | 133 DCHECK(!m_document->needsLayoutTreeUpdate()); |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 } | 885 } |
884 | 886 |
885 } // namespace blink | 887 } // namespace blink |
886 | 888 |
887 #ifndef NDEBUG | 889 #ifndef NDEBUG |
888 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { | 890 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { |
889 if (controller) | 891 if (controller) |
890 controller->showMarkers(); | 892 controller->showMarkers(); |
891 } | 893 } |
892 #endif | 894 #endif |
OLD | NEW |