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

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: Move offset calculation into DocumentMarker 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 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 dbcfdf2964555be13aa50b7551bf2305f37a6fd8..7ea4dbfdee54789b8289f6ca8e4c3cc25c39cc7b 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarker.h
@@ -161,6 +161,16 @@ class CORE_EXPORT DocumentMarker : public GarbageCollected<DocumentMarker> {
void setActiveMatch(bool);
void clearDetails() { m_details.clear(); }
+ struct ShiftMarkerResult {
+ unsigned newStartOffset;
+ unsigned newEndOffset;
+ bool shouldRemoveMarker;
+ };
+
+ ShiftMarkerResult getShiftedMarkerPosition(unsigned offset,
Xiaocheng 2017/03/29 23:25:08 Please also move its unit tests to this patch.
+ unsigned oldLength,
+ unsigned newLength) const;
+
// Offset modifications are done by DocumentMarkerController.
// Other classes should not call following setters.
void setStartOffset(unsigned offset) { m_startOffset = offset; }

Powered by Google App Engine
This is Rietveld 408576698