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

Issue 2755953004: Refactor DocumentMarkerController to use SynchronousMutationObserver (Closed)

Created:
3 years, 9 months ago by rlanday
Modified:
3 years, 9 months ago
Reviewers:
tkent, *yosin_UTC9
CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -10 lines) Patch
M third_party/WebKit/Source/core/dom/CharacterData.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h View 2 chunks +10 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp View 3 chunks +16 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 15 (10 generated)
rlanday
3 years, 9 months ago (2017-03-17 17:59:19 UTC) #5
yosin_UTC9
lgtm I really love using SMO! +tkent@ for core/dom changes.
3 years, 9 months ago (2017-03-21 03:33:45 UTC) #9
tkent
lgtm
3 years, 9 months ago (2017-03-21 03:37:00 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2755953004/1
3 years, 9 months ago (2017-03-21 18:08:34 UTC) #12
commit-bot: I haz the power
3 years, 9 months ago (2017-03-21 19:47:01 UTC) #15
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/c8529921548accf5f93751f6f997...

Powered by Google App Engine
This is Rietveld 408576698