Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp

Issue 2912133003: Revert of [DMC #17] Make TextMatchMarkers constructible in single step (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
155 void DocumentMarkerController::AddTextMatchMarker( 155 void DocumentMarkerController::AddTextMatchMarker(
156 const EphemeralRange& range, 156 const EphemeralRange& range,
157 DocumentMarker::MatchStatus match_status) { 157 DocumentMarker::MatchStatus match_status) {
158 DCHECK(!document_->NeedsLayoutTreeUpdate()); 158 DCHECK(!document_->NeedsLayoutTreeUpdate());
159 159
160 // Use a TextIterator to visit the potentially multiple nodes the range 160 // Use a TextIterator to visit the potentially multiple nodes the range
161 // covers. 161 // covers.
162 for (TextIterator marked_text(range.StartPosition(), range.EndPosition()); 162 for (TextIterator marked_text(range.StartPosition(), range.EndPosition());
163 !marked_text.AtEnd(); marked_text.Advance()) { 163 !marked_text.AtEnd(); marked_text.Advance()) {
164 AddMarker(marked_text.CurrentContainer(), 164 AddMarker(marked_text.CurrentContainer(),
165 new TextMatchMarker(marked_text.StartOffsetInCurrentContainer(), 165 new DocumentMarker(marked_text.StartOffsetInCurrentContainer(),
166 marked_text.EndOffsetInCurrentContainer(), 166 marked_text.EndOffsetInCurrentContainer(),
167 match_status)); 167 match_status));
168 } 168 }
169 // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a 169 // Don't invalidate tickmarks here. TextFinder invalidates tickmarks using a
170 // throttling algorithm. crbug.com/6819. 170 // throttling algorithm. crbug.com/6819.
171 } 171 }
172 172
173 void DocumentMarkerController::AddCompositionMarker(const EphemeralRange& range, 173 void DocumentMarkerController::AddCompositionMarker(const EphemeralRange& range,
174 Color underline_color, 174 Color underline_color,
175 bool thick, 175 bool thick,
176 Color background_color) { 176 Color background_color) {
177 DCHECK(!document_->NeedsLayoutTreeUpdate()); 177 DCHECK(!document_->NeedsLayoutTreeUpdate());
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 708 }
709 709
710 } // namespace blink 710 } // namespace blink
711 711
712 #ifndef NDEBUG 712 #ifndef NDEBUG
713 void showDocumentMarkers(const blink::DocumentMarkerController* controller) { 713 void showDocumentMarkers(const blink::DocumentMarkerController* controller) {
714 if (controller) 714 if (controller)
715 controller->ShowMarkers(); 715 controller->ShowMarkers();
716 } 716 }
717 #endif 717 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698