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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void DocumentMarkerController::RemoveMarkers( | 155 void DocumentMarkerController::RemoveMarkers( |
156 TextIterator& marked_text, | 156 TextIterator& marked_text, |
157 DocumentMarker::MarkerTypes marker_types) { | 157 DocumentMarker::MarkerTypes marker_types) { |
158 for (; !marked_text.AtEnd(); marked_text.Advance()) { | 158 for (; !marked_text.AtEnd(); marked_text.Advance()) { |
159 if (!PossiblyHasMarkers(marker_types)) | 159 if (!PossiblyHasMarkers(marker_types)) |
160 return; | 160 return; |
161 DCHECK(!markers_.IsEmpty()); | 161 DCHECK(!markers_.IsEmpty()); |
162 | 162 |
163 int start_offset = marked_text.StartOffsetInCurrentContainer(); | 163 int start_offset = marked_text.StartOffsetInCurrentContainer(); |
164 int end_offset = marked_text.EndOffsetInCurrentContainer(); | 164 int end_offset = marked_text.EndOffsetInCurrentContainer(); |
165 RemoveMarkers(marked_text.CurrentContainer(), start_offset, | 165 RemoveMarkersInternal(marked_text.CurrentContainer(), start_offset, |
166 end_offset - start_offset, marker_types); | 166 end_offset - start_offset, marker_types); |
167 } | 167 } |
168 } | 168 } |
169 | 169 |
170 void DocumentMarkerController::RemoveMarkersInRange( | 170 void DocumentMarkerController::RemoveMarkersInRange( |
171 const EphemeralRange& range, | 171 const EphemeralRange& range, |
172 DocumentMarker::MarkerTypes marker_types) { | 172 DocumentMarker::MarkerTypes marker_types) { |
173 DCHECK(!document_->NeedsLayoutTreeUpdate()); | 173 DCHECK(!document_->NeedsLayoutTreeUpdate()); |
174 | 174 |
175 TextIterator marked_text(range.StartPosition(), range.EndPosition()); | 175 TextIterator marked_text(range.StartPosition(), range.EndPosition()); |
176 DocumentMarkerController::RemoveMarkers(marked_text, marker_types); | 176 DocumentMarkerController::RemoveMarkers(marked_text, marker_types); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 doc_dirty = true; | 265 doc_dirty = true; |
266 } | 266 } |
267 | 267 |
268 // repaint the affected node | 268 // repaint the affected node |
269 if (doc_dirty && dst_node->GetLayoutObject()) { | 269 if (doc_dirty && dst_node->GetLayoutObject()) { |
270 dst_node->GetLayoutObject()->SetShouldDoFullPaintInvalidation( | 270 dst_node->GetLayoutObject()->SetShouldDoFullPaintInvalidation( |
271 kPaintInvalidationDocumentMarkerChange); | 271 kPaintInvalidationDocumentMarkerChange); |
272 } | 272 } |
273 } | 273 } |
274 | 274 |
275 void DocumentMarkerController::RemoveMarkers( | 275 void DocumentMarkerController::RemoveMarkersInternal( |
276 Node* node, | 276 Node* node, |
277 unsigned start_offset, | 277 unsigned start_offset, |
278 int length, | 278 int length, |
279 DocumentMarker::MarkerTypes marker_types) { | 279 DocumentMarker::MarkerTypes marker_types) { |
280 if (length <= 0) | 280 if (length <= 0) |
281 return; | 281 return; |
282 | 282 |
283 if (!PossiblyHasMarkers(marker_types)) | 283 if (!PossiblyHasMarkers(marker_types)) |
284 return; | 284 return; |
285 DCHECK(!(markers_.IsEmpty())); | 285 DCHECK(!(markers_.IsEmpty())); |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 } | 745 } |
746 | 746 |
747 } // namespace blink | 747 } // namespace blink |
748 | 748 |
749 #ifndef NDEBUG | 749 #ifndef NDEBUG |
750 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { | 750 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { |
751 if (controller) | 751 if (controller) |
752 controller->ShowMarkers(); | 752 controller->ShowMarkers(); |
753 } | 753 } |
754 #endif | 754 #endif |
OLD | NEW |