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

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: Make requested changes, refactor tests 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() : m_markersAreSorted(true) {}
13
14 bool EditingMarkerList::isEditingMarkerList() const {
15 return true;
16 }
17
18 void EditingMarkerList::push_back(DocumentMarker* marker) {
19 DCHECK(marker->type() == allowedMarkerType());
20 if (m_markersAreSorted && !m_markers.isEmpty() &&
21 m_markers.back()->endOffset() > marker->startOffset())
22 m_markersAreSorted = false;
23 m_markers.push_back(marker);
24 }
25
26 void EditingMarkerList::clear() {
27 m_markersAreSorted = true;
28 DocumentMarkerList::clear();
29 }
30
31 bool EditingMarkerList::markerListIsSorted() const {
32 return m_markersAreSorted;
33 }
34
35 DEFINE_TRACE(EditingMarkerList) {
36 visitor->trace(m_markers);
37 DocumentMarkerList::trace(visitor);
38 }
39
40 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698