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

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

Issue 2895353003: Split DMLEditor::ShiftMarkers() into content-dependent and -independent versions (Closed)
Patch Set: Created 3 years, 7 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/DocumentMarkerListEditor.h
diff --git a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
index 55d10c1a0fdfccd398408fd7c587406c4c496770..5da062001d5e49e6e8e7205554b8ca205d648d68 100644
--- a/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
+++ b/third_party/WebKit/Source/core/editing/markers/DocumentMarkerListEditor.h
@@ -26,11 +26,25 @@ class DocumentMarkerListEditor {
// Returns true if a marker was removed, false otherwise.
static bool RemoveMarkers(MarkerList*, unsigned start_offset, int length);
+ // The following two methods both update the position of a list's
+ // DocumentMarkers in response to editing operations. The difference is that
+ // if an editing operation actually changes the text spanned by a marker (as
+ // opposed to only changing text before or after the marker),
+ // ShiftMarkersContentDependent will remove the marker, and
+ // ShiftMarkersContentIndependent will attempt to keep tracking the marked
+ // region across edits.
+
+ // Returns true if a marker was shifted or removed, false otherwise.
+ static bool ShiftMarkersContentDependent(MarkerList*,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
+
// Returns true if a marker was shifted or removed, false otherwise.
- static bool ShiftMarkers(MarkerList*,
- unsigned offset,
- unsigned old_length,
- unsigned new_length);
+ static bool ShiftMarkersContentIndependent(MarkerList*,
+ unsigned offset,
+ unsigned old_length,
+ unsigned new_length);
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698