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

Unified Diff: third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h

Issue 2692093003: Rewrite DocumentMarkerController to use SynchronousMutationObserver (Closed)
Patch Set: Fx tests to match current behavior of master Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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 08b2e64320847b16760d3d3654e6b97e170044b2..060c6b305b1149c465c58af5e5a460c015493c06 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,
@@ -105,7 +108,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
@@ -130,6 +132,12 @@ class CORE_EXPORT DocumentMarkerController final
void showMarkers() const;
#endif
+ // SynchronousMutationObserver
+ void didUpdateCharacterData(CharacterData*,
+ unsigned offset,
+ unsigned oldLength,
+ unsigned newLength) final;
+
private:
void addMarker(Node*, const DocumentMarker&);

Powered by Google App Engine
This is Rietveld 408576698