Index: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
index 34d0f267b06cb3f836c2f8884d7bec74da9cde96..bcd90f57423f196dc3a50be458884d22d6f84e9f 100644 |
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h |
@@ -30,6 +30,7 @@ |
#define DocumentMarkerController_h |
#include "core/CoreExport.h" |
+#include "core/dom/SynchronousMutationObserver.h" |
#include "core/editing/iterators/TextIterator.h" |
#include "core/editing/markers/DocumentMarker.h" |
#include "platform/geometry/IntRect.h" |
@@ -53,11 +54,13 @@ class MarkerRemoverPredicate final { |
}; |
class CORE_EXPORT DocumentMarkerController final |
- : public GarbageCollected<DocumentMarkerController> { |
+ : public GarbageCollected<DocumentMarkerController>, |
+ public SynchronousMutationObserver { |
WTF_MAKE_NONCOPYABLE(DocumentMarkerController); |
+ USING_GARBAGE_COLLECTED_MIXIN(DocumentMarkerController); |
public: |
- explicit DocumentMarkerController(const Document&); |
+ explicit DocumentMarkerController(Document&); |
void clear(); |
void addMarker(const Position& start, |
@@ -106,7 +109,6 @@ class CORE_EXPORT DocumentMarkerController final |
void removeMarkers(const MarkerRemoverPredicate& shouldRemoveMarker); |
void repaintMarkers( |
DocumentMarker::MarkerTypes = DocumentMarker::AllMarkers()); |
- void shiftMarkers(Node*, unsigned startOffset, int delta); |
// Returns true if markers within a range are found. |
bool setMarkersActive(const EphemeralRange&, bool); |
// Returns true if markers within a range defined by a node, |startOffset| and |
@@ -131,6 +133,12 @@ class CORE_EXPORT DocumentMarkerController final |
void showMarkers() const; |
#endif |
+ // SynchronousMutationObserver |
+ void didUpdateCharacterData(CharacterData*, |
+ unsigned offset, |
+ unsigned oldLength, |
+ unsigned newLength) override; |
+ |
private: |
void addMarker(Node*, const DocumentMarker&); |
@@ -144,6 +152,7 @@ class CORE_EXPORT DocumentMarkerController final |
void removeMarkers(TextIterator&, |
DocumentMarker::MarkerTypes, |
RemovePartiallyOverlappingMarkerOrNot); |
+ void removeZeroLengthMarkers(); |
MarkerMap m_markers; |
// Provide a quick way to determine whether a particular marker type is absent |