|
|
DescriptionImprove how DocumentMarkerController updates markers in response to text edits
This is basically https://codereview.chromium.org/2692093003 with the changes to
make DocumentMarkerController use SynchronousMutationObserver split off into a
separate CL (https://codereview.chromium.org/2755953004).
I need DocumentMarkerController to update markers more gracefully in response to
edits in order to implement SuggestionSpan support on Android. For example, if
we have the string "word1 word2" marked with a DocumentMarker and
CompositeEditCommand::replaceTextInNode() is used to replace word1 or word2 with
different text, the new text should still be inside the marked range.
There's currently a method
CompositeEditCommand::replaceTextInNodePreservingMarkers(), which was added to
fix some particular case to support a marker type which no longer exists
(DeletedAutocorrection): https://bugs.webkit.org/show_bug.cgi?id=60555
This is no longer necessary after this CL since we can handle all the updates
more correctly inside DocumentMarkerController. For example, if we have a string
like "Initial text blah" and we add a marker around " text " and delete
"Initial" and "blah", we end up with " text ". Then
DeleteSelectionCommand::fixupWhitespace() runs, and replaces the spaces with
non-breaking spaces. The current behavior is that the NBSPs are no longer in the
marked range, since DocumentMarkerController doesn't currently support keeping
the replaced text in the marked range, but replaceTextInNodePreservingMarkers()
runs and adds new markers to the NBSPs. So we still end up with " text " being
marked but now we have three separate markers, which is undesirable for some
use cases (e.g. text suggestions, because we don't know what range of text we're
actually supposed to replace now). With the changes in this CL,
DocumentMarkerController is able to keep a single marker around " text ".
The changes to the expected output for InputMethodControllerTest may be helpful
in understanding the behavioral changes here.
BUG=672259
Review-Url: https://codereview.chromium.org/2755013004
Cr-Commit-Position: refs/heads/master@{#464236}
Committed: https://chromium.googlesource.com/chromium/src/+/d6ef615a1a2154d3435b9a09afcd8f6cd929f275
Patch Set 1 #Patch Set 2 : Rebase on master (shouldn't be any actual changes) #Patch Set 3 : Rebase on MarkerTypeIterator so trybots for CLs that need that can build properly #Patch Set 4 : Rebase #
Total comments: 1
Patch Set 5 : Put shifting logic in relocateMarkerIfNeeded() method #
Total comments: 2
Patch Set 6 : Fix insertion behavior, add tests, remove TODO #Patch Set 7 : Fix case where beginning of marker is being replaced #Patch Set 8 : Remove logging code #Patch Set 9 : Rebase (attempting to fix failing test bots) #Patch Set 10 : Rebase (Vector::remove() => Vector::erase()) #
Total comments: 3
Patch Set 11 : Move offset calculation into DocumentMarker #
Total comments: 1
Patch Set 12 : Include DocumentMarker tests #
Total comments: 1
Patch Set 13 : Rename getShiftedMarkerPosition(), use Optional #Patch Set 14 : Rebase, don't accidentally include two other CLs #Patch Set 15 : Rebase #Patch Set 16 : Rebase, remove dependencies #Patch Set 17 : Actually remove dependencies #Patch Set 18 : Split up InputMethodControllerTest test cases #Patch Set 19 : Rebase on renaming; don't split markers on delete #Patch Set 20 : Rename a few more things #Patch Set 21 : Rebase #Dependent Patchsets: Messages
Total messages: 111 (77 generated)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
rlanday@chromium.org changed reviewers: + xiaochengh@chromium.org, yosin@chromium.org
rlanday@chromium.org changed required reviewers: + yosin@chromium.org
Still lgtm.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...) win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_...)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
almost good shape! https://codereview.chromium.org/2755013004/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2755013004/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:853: if (marker.startOffset() > offset) { It is nice if we can move this logic into function. if (relocateMarkerIfNeeded(&marker, offset, newLength, oldLength)) didShiftMarker = true; It is easier to read.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/03/23 at 04:10:26, yosin wrote: > almost good shape! > > https://codereview.chromium.org/2755013004/diff/60001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): > > https://codereview.chromium.org/2755013004/diff/60001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:853: if (marker.startOffset() > offset) { > It is nice if we can move this logic into function. > > if (relocateMarkerIfNeeded(&marker, offset, newLength, oldLength)) > didShiftMarker = true; > > It is easier to read. Ok, I've updated the CL. Note that this code arrangement is going to be changed again by the DocumentMarkerController refactor (right now I have the shifting logic as a method on DocumentMarker).
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_clang on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/...)
https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:658: if (marker->startOffset() > offset) { I think there's one more tweak we want to make: as written, if an insertion happens right where a marker starts, the new text will be included in the marker. E.g. if we have a marker from 5 to 10 and do an insert with offset 5, oldLength 0, and newLength 5, the new marker will be from 5 to 15 instead of 10 to 15. We can fix this by writing >= here instead of >. https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:661: if (marker->startOffset() < offset + oldLength) { Since we're moving the marker start to the end of the new text, it doesn't matter if this is <= or < (offset + newLength == marker->startOffset() + newLength - oldLength if marker->startOffset() == offset + oldLength), so I'm going to change this back to <= to be consistent with the concept-cd-replace algorithm
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
On 2017/03/23 at 22:52:00, rlanday wrote: > https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): > > https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:658: if (marker->startOffset() > offset) { > I think there's one more tweak we want to make: as written, if an insertion happens right where a marker starts, the new text will be included in the marker. E.g. if we have a marker from 5 to 10 and do an insert with offset 5, oldLength 0, and newLength 5, the new marker will be from 5 to 15 instead of 10 to 15. We can fix this by writing >= here instead of >. > > https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:661: if (marker->startOffset() < offset + oldLength) { > Since we're moving the marker start to the end of the new text, it doesn't matter if this is <= or < (offset + newLength == marker->startOffset() + newLength - oldLength if marker->startOffset() == offset + oldLength), so I'm going to change this back to <= to be consistent with the concept-cd-replace algorithm Updated with these changes (I also added more test cases)
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/03/24 at 00:54:42, rlanday wrote: > On 2017/03/23 at 22:52:00, rlanday wrote: > > https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... > > File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): > > > > https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... > > third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:658: if (marker->startOffset() > offset) { > > I think there's one more tweak we want to make: as written, if an insertion happens right where a marker starts, the new text will be included in the marker. E.g. if we have a marker from 5 to 10 and do an insert with offset 5, oldLength 0, and newLength 5, the new marker will be from 5 to 15 instead of 10 to 15. We can fix this by writing >= here instead of >. > > > > https://codereview.chromium.org/2755013004/diff/80001/third_party/WebKit/Sour... > > third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:661: if (marker->startOffset() < offset + oldLength) { > > Since we're moving the marker start to the end of the new text, it doesn't matter if this is <= or < (offset + newLength == marker->startOffset() + newLength - oldLength if marker->startOffset() == offset + oldLength), so I'm going to change this back to <= to be consistent with the concept-cd-replace algorithm > > Updated with these changes (I also added more test cases) Actually this is still not correct, the WhitespaceFixup tests are failing now, don't bother reviewing this until I update it again :)
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Ok, all the tests are passing now, I think the behavior is correct :)
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2017/03/24 at 01:23:21, rlanday wrote: > Ok, all the tests are passing now, I think the behavior is correct :) Compilation error... (T_T) FAILED: obj/third_party/WebKit/Source/core/editing/unit_tests/InputMethodControllerTest.obj ninja -t msvc -e environment.x86 -- E:\b\c\goma_client/gomacc.exe "E:\b\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/third_party/WebKit/Source/core/editing/unit_tests/InputMethodControllerTest.obj.rsp /c ../../third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp /Foobj/third_party/WebKit/Source/core/editing/unit_tests/InputMethodControllerTest.obj /Fd"obj/third_party/WebKit/Source/core/editing/unit_tests_cc.pdb" e:\b\c\b\win\src\third_party\webkit\source\core\editing\inputmethodcontrollertest.cpp(1887): error C2039: 'showMarkers': is not a member of 'blink::DocumentMarkerController' e:\b\c\b\win\src\third_party\webkit\source\core\editing\markers\documentmarkercontroller.h(57): note: see declaration of 'blink::DocumentMarkerController'
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2017/03/24 at 01:54:57, yosin wrote: > On 2017/03/24 at 01:23:21, rlanday wrote: > > Ok, all the tests are passing now, I think the behavior is correct :) > > Compilation error... (T_T) > > FAILED: obj/third_party/WebKit/Source/core/editing/unit_tests/InputMethodControllerTest.obj > ninja -t msvc -e environment.x86 -- E:\b\c\goma_client/gomacc.exe "E:\b\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/third_party/WebKit/Source/core/editing/unit_tests/InputMethodControllerTest.obj.rsp /c ../../third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp /Foobj/third_party/WebKit/Source/core/editing/unit_tests/InputMethodControllerTest.obj /Fd"obj/third_party/WebKit/Source/core/editing/unit_tests_cc.pdb" > e:\b\c\b\win\src\third_party\webkit\source\core\editing\inputmethodcontrollertest.cpp(1887): error C2039: 'showMarkers': is not a member of 'blink::DocumentMarkerController' > e:\b\c\b\win\src\third_party\webkit\source\core\editing\markers\documentmarkercontroller.h(57): note: see declaration of 'blink::DocumentMarkerController'
Oops, hit "Send Message" too quick... I had accidentally left some logging code in, the latest version compiles properly (except for two trybots that appear to be acting up)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/03/24 at 03:48:02, rlanday wrote: > Oops, hit "Send Message" too quick... > > I had accidentally left some logging code in, the latest version compiles properly (except for two trybots that appear to be acting up)
I got the trybots working (and slipped on the "Send Message" button again..."
I got the trybots working (and slipped on the "Send Message" button again..."
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_TIMED_OUT, build hasn't started yet, builder probably lacks capacity)
There are two seemingly orthogonal change: Removal of CEC::replaceTextInNodePreservingMarkers, and modification to DMC in its didUpdateCharacterData callback. Could you clarify which one changes which behavior, and if possible, split the patch? Sorry for lengthening the iteration... https://codereview.chromium.org/2755013004/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2755013004/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1786: TEST_F(InputMethodControllerTest, Marker_Deletions) { Could you split it into three tests? https://codereview.chromium.org/2755013004/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:1868: TEST_F(InputMethodControllerTest, Marker_Insertions) { Could you split it into two tests?
https://codereview.chromium.org/2755013004/diff/180001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp (right): https://codereview.chromium.org/2755013004/diff/180001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp:649: bool DocumentMarkerController::relocateMarkerIfNeeded( Can we implement this function directly in DocumentMarker, so that we don't need to move it in the DocumentMarkerList patch?
Talked offline. This patch moves the functionality of the removed function to DMC, so the two changes are not orthogonal. Still looks good. The only requested change is to implement the offset calculation for marker shifting directly in DocumentMarker.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/03/29 at 19:37:55, xiaochengh wrote: > Talked offline. This patch moves the functionality of the removed function to DMC, so the two changes are not orthogonal. > > Still looks good. The only requested change is to implement the offset calculation for marker shifting directly in DocumentMarker. Ok, updated
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2755013004/diff/200001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/editing/markers/DocumentMarker.h (right): https://codereview.chromium.org/2755013004/diff/200001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/markers/DocumentMarker.h:170: ShiftMarkerResult getShiftedMarkerPosition(unsigned offset, Please also move its unit tests to this patch.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
On 2017/03/29 at 23:25:08, xiaochengh wrote: > https://codereview.chromium.org/2755013004/diff/200001/third_party/WebKit/Sou... > File third_party/WebKit/Source/core/editing/markers/DocumentMarker.h (right): > > https://codereview.chromium.org/2755013004/diff/200001/third_party/WebKit/Sou... > third_party/WebKit/Source/core/editing/markers/DocumentMarker.h:170: ShiftMarkerResult getShiftedMarkerPosition(unsigned offset, > Please also move its unit tests to this patch. Oops! Fixed
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm
https://codereview.chromium.org/2755013004/diff/220001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/editing/markers/DocumentMarker.h (right): https://codereview.chromium.org/2755013004/diff/220001/third_party/WebKit/Sou... third_party/WebKit/Source/core/editing/markers/DocumentMarker.h:170: ShiftMarkerResult getShiftedMarkerPosition(unsigned offset, Since this function is not getter, please use another name, e.g. computeShiftAmoutAt(), or another better name. How about using Optional<T>, == std::optional? We could write: struct ShiftAmount { unsigned newStartOffset; unsinged newEndOffset }; Optional<ShiftAmount> cmputeShiftAmount(...) { ... if (no need to shift) return WTF::nullopt; return shiftAmount; }
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_TIMED_OUT, build hasn't started yet, builder probably lacks capacity)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
On 2017/03/30 at 01:46:08, yosin wrote: > https://codereview.chromium.org/2755013004/diff/220001/third_party/WebKit/Sou... > File third_party/WebKit/Source/core/editing/markers/DocumentMarker.h (right): > > https://codereview.chromium.org/2755013004/diff/220001/third_party/WebKit/Sou... > third_party/WebKit/Source/core/editing/markers/DocumentMarker.h:170: ShiftMarkerResult getShiftedMarkerPosition(unsigned offset, > Since this function is not getter, please use another name, e.g. computeShiftAmoutAt(), or another better name. > How about using Optional<T>, == std::optional? > > We could write: > struct ShiftAmount { unsigned newStartOffset; unsinged newEndOffset }; > > Optional<ShiftAmount> cmputeShiftAmount(...) { > ... > if (no need to shift) > return WTF::nullopt; > return shiftAmount; > } Updated
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm6...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) win_clang on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_clang/builds/...)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
The CQ bit was unchecked by rlanday@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
This CL has no dependencies, are there any remaining issues? I just split up the test cases since I think I'm going to change one of the behaviors (whether or not markers are split when removing text) in another CL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2017/04/07 at 00:50:58, rlanday wrote: > This CL has no dependencies, are there any remaining issues? I just split up the test cases since I think I'm going to change one of the behaviors (whether or not markers are split when removing text) in another CL Could you rebase and upload for grate blink renaming?
On 2017/04/10 at 03:22:09, yosin wrote: > Could you rebase and upload for grate blink renaming? Ok, I've done that. I also moved one more behavioral change from the "don't ever split DocumentMarker" CL (https://codereview.chromium.org/2806683002) into this CL (since xiaochengh asked me to): we're no longer splitting markers on a deletion/zero-length replacement. Instead, we keep the endpoints in the same location relative to the surrounding text and just remove the text in the middle. So before if we had a marker on "abc" and deleted "b", we'd have "ac" with markers on "a" and "c". Now we'll have "ac" with one marker on "ac".
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
still lgtm (seems to be the third one I gave to this CL)
lgtm
The CQ bit was checked by rlanday@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from xiaochengh@chromium.org Link to the patchset: https://codereview.chromium.org/2755013004/#ps400001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rlanday@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 400001, "attempt_start_ts": 1492033681918480, "parent_rev": "12281bd8755744a457842d926b0df999dfd5db9e", "commit_rev": "05cf1a871bb88c8bc0a14fd9034443dd8eae4305"}
The CQ bit was unchecked by commit-bot@chromium.org
Prior attempt to commit was detected, but we were not able to check whether the issue was successfully committed. Please check Git history manually and re-check CQ or close this issue as needed.
The CQ bit was checked by rlanday@chromium.org
The CQ bit was checked by aelias@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 400001, "attempt_start_ts": 1492045476581410, "parent_rev": "ede160c50d85e5fd546ec8134714b35c71c0e2f1", "commit_rev": "d6ef615a1a2154d3435b9a09afcd8f6cd929f275"}
Message was sent while issue was closed.
Description was changed from ========== Improve how DocumentMarkerController updates markers in response to text edits This is basically https://codereview.chromium.org/2692093003 with the changes to make DocumentMarkerController use SynchronousMutationObserver split off into a separate CL (https://codereview.chromium.org/2755953004). I need DocumentMarkerController to update markers more gracefully in response to edits in order to implement SuggestionSpan support on Android. For example, if we have the string "word1 word2" marked with a DocumentMarker and CompositeEditCommand::replaceTextInNode() is used to replace word1 or word2 with different text, the new text should still be inside the marked range. There's currently a method CompositeEditCommand::replaceTextInNodePreservingMarkers(), which was added to fix some particular case to support a marker type which no longer exists (DeletedAutocorrection): https://bugs.webkit.org/show_bug.cgi?id=60555 This is no longer necessary after this CL since we can handle all the updates more correctly inside DocumentMarkerController. For example, if we have a string like "Initial text blah" and we add a marker around " text " and delete "Initial" and "blah", we end up with " text ". Then DeleteSelectionCommand::fixupWhitespace() runs, and replaces the spaces with non-breaking spaces. The current behavior is that the NBSPs are no longer in the marked range, since DocumentMarkerController doesn't currently support keeping the replaced text in the marked range, but replaceTextInNodePreservingMarkers() runs and adds new markers to the NBSPs. So we still end up with " text " being marked but now we have three separate markers, which is undesirable for some use cases (e.g. text suggestions, because we don't know what range of text we're actually supposed to replace now). With the changes in this CL, DocumentMarkerController is able to keep a single marker around " text ". The changes to the expected output for InputMethodControllerTest may be helpful in understanding the behavioral changes here. BUG=672259 ========== to ========== Improve how DocumentMarkerController updates markers in response to text edits This is basically https://codereview.chromium.org/2692093003 with the changes to make DocumentMarkerController use SynchronousMutationObserver split off into a separate CL (https://codereview.chromium.org/2755953004). I need DocumentMarkerController to update markers more gracefully in response to edits in order to implement SuggestionSpan support on Android. For example, if we have the string "word1 word2" marked with a DocumentMarker and CompositeEditCommand::replaceTextInNode() is used to replace word1 or word2 with different text, the new text should still be inside the marked range. There's currently a method CompositeEditCommand::replaceTextInNodePreservingMarkers(), which was added to fix some particular case to support a marker type which no longer exists (DeletedAutocorrection): https://bugs.webkit.org/show_bug.cgi?id=60555 This is no longer necessary after this CL since we can handle all the updates more correctly inside DocumentMarkerController. For example, if we have a string like "Initial text blah" and we add a marker around " text " and delete "Initial" and "blah", we end up with " text ". Then DeleteSelectionCommand::fixupWhitespace() runs, and replaces the spaces with non-breaking spaces. The current behavior is that the NBSPs are no longer in the marked range, since DocumentMarkerController doesn't currently support keeping the replaced text in the marked range, but replaceTextInNodePreservingMarkers() runs and adds new markers to the NBSPs. So we still end up with " text " being marked but now we have three separate markers, which is undesirable for some use cases (e.g. text suggestions, because we don't know what range of text we're actually supposed to replace now). With the changes in this CL, DocumentMarkerController is able to keep a single marker around " text ". The changes to the expected output for InputMethodControllerTest may be helpful in understanding the behavioral changes here. BUG=672259 Review-Url: https://codereview.chromium.org/2755013004 Cr-Commit-Position: refs/heads/master@{#464236} Committed: https://chromium.googlesource.com/chromium/src/+/d6ef615a1a2154d3435b9a09afcd... ==========
Message was sent while issue was closed.
Committed patchset #21 (id:400001) as https://chromium.googlesource.com/chromium/src/+/d6ef615a1a2154d3435b9a09afcd... |