Index: third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp |
diff --git a/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a37da72d89fc29b2955f5df2e1a44cb7d255f3f6 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/editing/markers/CompositionMarkerList.cpp |
@@ -0,0 +1,92 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "core/editing/markers/CompositionMarkerList.h" |
+ |
+#include "core/editing/markers/DocumentMarkerListUtils.h" |
+ |
+namespace blink { |
+ |
+CompositionMarkerList::CompositionMarkerList() : DocumentMarkerList() {} |
+ |
+DocumentMarker::MarkerType CompositionMarkerList::allowedMarkerType() const { |
+ return DocumentMarker::Composition; |
+} |
+ |
+bool CompositionMarkerList::isCompositionMarkerList() const { |
+ return true; |
+} |
+ |
+size_t CompositionMarkerList::size() const { |
+ return m_markers.size(); |
+} |
+ |
+bool CompositionMarkerList::empty() const { |
+ return m_markers.isEmpty(); |
+} |
+ |
+DocumentMarker* CompositionMarkerList::at(size_t index) { |
+ return m_markers[index].get(); |
+} |
+ |
+void CompositionMarkerList::add(DocumentMarker* marker) { |
+ m_markers.push_back(marker); |
+} |
+ |
+void CompositionMarkerList::clear() { |
+ m_markers.clear(); |
+} |
+ |
+CompositionMarkerList::iterator CompositionMarkerList::begin() { |
+ return m_markers.begin(); |
+} |
+ |
+CompositionMarkerList::iterator CompositionMarkerList::end() { |
+ return m_markers.end(); |
+} |
+ |
+CompositionMarkerList::const_iterator CompositionMarkerList::begin() const { |
+ return m_markers.begin(); |
+} |
+ |
+CompositionMarkerList::const_iterator CompositionMarkerList::end() const { |
+ return m_markers.end(); |
+} |
+ |
+void CompositionMarkerList::appendMarkersToInputList( |
+ DocumentMarkerVector* list) const { |
+ DocumentMarkerListUtils::appendMarkersToInputList(&m_markers, list); |
+} |
+ |
+DocumentMarkerList::DidCopyMarkerOrNot CompositionMarkerList::copyMarkers( |
+ unsigned startOffset, |
+ int length, |
+ DocumentMarkerList* dstList, |
+ int delta) { |
+ return DocumentMarkerListUtils::copyUnsortedMarkers(&m_markers, startOffset, |
+ length, dstList, delta); |
+} |
+ |
+DocumentMarkerList::DidRemoveMarkerOrNot CompositionMarkerList::removeMarkers( |
+ unsigned startOffset, |
+ int length, |
+ bool shouldRemovePartiallyOverlappingMarkers) { |
+ return DocumentMarkerListUtils::removeUnsortedMarkers( |
+ &m_markers, startOffset, length, shouldRemovePartiallyOverlappingMarkers); |
+} |
+ |
+DocumentMarkerList::DidShiftMarkerOrNot CompositionMarkerList::shiftMarkers( |
+ unsigned offset, |
+ unsigned oldLength, |
+ unsigned newLength) { |
+ return DocumentMarkerListUtils::shiftUnsortedMarkers(&m_markers, offset, |
+ oldLength, newLength); |
+} |
+ |
+DEFINE_TRACE(CompositionMarkerList) { |
+ visitor->trace(m_markers); |
+ DocumentMarkerList::trace(visitor); |
+} |
+ |
+} // namespace blink |