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

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

Issue 2755013004: Improve how DocumentMarkerController updates markers in response to text edits (Closed)
Patch Set: Rebase Created 3 years, 8 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/DocumentMarker.h
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
index e1c9096c5b4aad0636e4b894d474edcfd4db26b6..9d22eb74d1707a33e9abaeee72db08537d4fe9ba 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
@@ -26,6 +26,7 @@
#include "core/CoreExport.h"
#include "platform/graphics/Color.h"
#include "platform/heap/Handle.h"
+#include "wtf/Optional.h"
#include "wtf/VectorTraits.h"
#include "wtf/text/WTFString.h"
@@ -164,6 +165,15 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
void SetIsActiveMatch(bool);
void ClearDetails() { details_.Clear(); }
+ struct MarkerOffsets {
+ unsigned start_offset;
+ unsigned end_offset;
+ };
+
+ Optional<MarkerOffsets> ComputeOffsetsAfterShift(unsigned offset,
+ unsigned old_length,
+ unsigned new_length) const;
+
// Offset modifications are done by DocumentMarkerController.
// Other classes should not call following setters.
void SetStartOffset(unsigned offset) { start_offset_ = offset; }

Powered by Google App Engine
This is Rietveld 408576698