| 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::RemoveMarkers( | 170 void DocumentMarkerController::RemoveMarkers( |
| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 doc_dirty = true; | 266 doc_dirty = true; |
| 267 } | 267 } |
| 268 | 268 |
| 269 // repaint the affected node | 269 // repaint the affected node |
| 270 if (doc_dirty && dst_node->GetLayoutObject()) { | 270 if (doc_dirty && dst_node->GetLayoutObject()) { |
| 271 dst_node->GetLayoutObject()->SetShouldDoFullPaintInvalidation( | 271 dst_node->GetLayoutObject()->SetShouldDoFullPaintInvalidation( |
| 272 kPaintInvalidationDocumentMarkerChange); | 272 kPaintInvalidationDocumentMarkerChange); |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 void DocumentMarkerController::RemoveMarkers( | 276 void DocumentMarkerController::RemoveMarkersInternal( |
| 277 Node* node, | 277 Node* node, |
| 278 unsigned start_offset, | 278 unsigned start_offset, |
| 279 int length, | 279 int length, |
| 280 DocumentMarker::MarkerTypes marker_types) { | 280 DocumentMarker::MarkerTypes marker_types) { |
| 281 if (length <= 0) | 281 if (length <= 0) |
| 282 return; | 282 return; |
| 283 | 283 |
| 284 if (!PossiblyHasMarkers(marker_types)) | 284 if (!PossiblyHasMarkers(marker_types)) |
| 285 return; | 285 return; |
| 286 DCHECK(!(markers_.IsEmpty())); | 286 DCHECK(!(markers_.IsEmpty())); |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 } | 765 } |
| 766 | 766 |
| 767 } // namespace blink | 767 } // namespace blink |
| 768 | 768 |
| 769 #ifndef NDEBUG | 769 #ifndef NDEBUG |
| 770 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { | 770 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { |
| 771 if (controller) | 771 if (controller) |
| 772 controller->ShowMarkers(); | 772 controller->ShowMarkers(); |
| 773 } | 773 } |
| 774 #endif | 774 #endif |
| OLD | NEW |