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

Side by Side Diff: Source/core/dom/DocumentMarkerController.cpp

Issue 24253004: Cleanup: Start using toFoo methods as part of newly adopted coding guideline. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/dom/Attr.cpp ('k') | Source/core/dom/Position.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
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
OLDNEW
« no previous file with comments | « Source/core/dom/Attr.cpp ('k') | Source/core/dom/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698