DescriptionRefactor DocumentMarkerController to use SynchronousMutationObserver
I had a previous CL up where I made this change combined with some behavioral
changes to DocumentMarkerController::shiftMarker():
https://codereview.chromium.org/2692093003
In this CL, I am only refactoring DMC to use SMO without making any other
behavioral changes. Whereas the other CL did all the marker updates in one pass
through shiftMarkers(), the most straightforward way to avoid introducing any
behavioral changes is to call removeMarkers() on the text being replaced, shift
the markers for the remove, and then shift the markers in the other direction
for the insert.
I will update the marker-shifting behavior to handle text replacement more
gracefully (i.e. not splitting the markers when text is removed, keeping
replaced text at the start/end of the marked range inside the range after
replacement) in a follow-up CL.
BUG=682878
Review-Url: https://codereview.chromium.org/2755953004
Cr-Commit-Position: refs/heads/master@{#458518}
Committed: https://chromium.googlesource.com/chromium/src/+/c8529921548accf5f93751f6f997bebe7e0683bd
Patch Set 1 #
Dependent Patchsets: Messages
Total messages: 15 (10 generated)
|