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

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

Issue 2773883003: Add CompositionMarkerList in preparation for DocumentMarkerController refactor (Closed)
Patch Set: Respond to comments Created 3 years, 9 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/editing/markers/EditingMarkerList.h"
6
7 #include <algorithm>
8 #include "core/editing/markers/DocumentMarkerController.h"
9
10 namespace blink {
11
12 EditingMarkerList::EditingMarkerList(
13 DocumentMarkerController* documentMarkerController)
14 : DocumentMarkerList(documentMarkerController), m_markersAreSorted(true) {}
15
16 bool EditingMarkerList::isEditingMarkerList() const {
17 return true;
18 }
19
20 void EditingMarkerList::clear() {
21 m_markers.clear();
22 m_markersAreSorted = true;
23 }
24
25 void EditingMarkerList::insert(DocumentMarker* marker) {
26 DCHECK(marker->type() == allowedMarkerType());
27 if (m_markersAreSorted && !m_markers.isEmpty() &&
28 m_markers.back()->endOffset() > marker->startOffset())
29 m_markersAreSorted = false;
30 m_markers.push_back(marker);
31 }
32
33 bool EditingMarkerList::markerListIsSorted() const {
34 return m_markersAreSorted;
35 }
36
37 DEFINE_TRACE(EditingMarkerList) {
38 visitor->trace(m_markers);
39 DocumentMarkerList::trace(visitor);
40 }
41
42 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698