|
|
Chromium Code Reviews|
Created:
3 years, 10 months ago by Xiaocheng Modified:
3 years, 10 months ago Reviewers:
yosin_UTC9 CC:
blink-reviews, chromium-reviews Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix undo stack ordering for all-but-typing commands
When one top-level editing command triggers another command via
event handlers, Blink used to have their undo ordering reversed.
The reason is that the enstacking of commands is not protected
by EventQueueScope; consequently, the commands are executed in
a nested manner, making the first command end later than the
second command.
This patch protects everything in CompositeEditCommand::apply
with EventQueueScope, so that the nesting behavior for all
commands (except TypingCommand) is eliminated.
BUG=685975
TEST=editing/undo/drag_with_mutation_event_undo_order.html
Review-Url: https://codereview.chromium.org/2674173002
Cr-Commit-Position: refs/heads/master@{#452095}
Committed: https://chromium.googlesource.com/chromium/src/+/91ce4c5c6b3c38b5291c94d897f691b30282cd79
Patch Set 1 #Patch Set 2 : Add layout test #
Total comments: 1
Patch Set 3 : Reuse sample #
Total comments: 2
Patch Set 4 : Minimize test #
Total comments: 2
Dependent Patchsets: Messages
Total messages: 33 (21 generated)
The CQ bit was checked by xiaochengh@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...
Description was changed from ========== Fix undo stack ordering for all-but-typing commands BUG= ========== to ========== Fix undo stack ordering for all-but-typing commands When one top-level editing command triggers another command via event handlers, Blink used to have their undo ordering reversed. The reason is that the enstacking of commands is not protected by EventQueueScope; consequently, the commands are executed in a nested manner, making the first command end later than the second command. This patch protects everything in CompositeEditCommand::apply with EventQueueScope, so that the nesting behavior for all commands (except TypingCommand) is eliminated. BUG=685975 TEST=editing/undo/drag_with_mutation_event_undo_order.html ==========
xiaochengh@chromium.org changed reviewers: + yosin@chromium.org
PTAL.
https://codereview.chromium.org/2674173002/diff/20001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/undo/drag_with_mutation_event_undo_order.html (right): https://codereview.chromium.org/2674173002/diff/20001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/undo/drag_with_mutation_event_undo_order.html:51: dragAndDrop(selection, 'source', 'div1'); Note: the first command must be initiated by user action instead of document.execCommand, because nested execution of execCommand is prohibited.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by xiaochengh@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: cast_shell_linux on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
https://codereview.chromium.org/2674173002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/undo/drag_with_mutation_event_undo_order.html (right): https://codereview.chromium.org/2674173002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/undo/drag_with_mutation_event_undo_order.html:72: 'undo', We don't need to check result of "undo" command, since functionality of "undo" is checked in other tests. The thing we want to verify this test is L80. So, verifying result of drag-and-drop and undo is "pre-condition" check. See comment in PS#4 of https://codereview.chromium.org/2685723005
The CQ bit was checked by xiaochengh@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...
Patch updated with test case minimized. PTAL. https://codereview.chromium.org/2674173002/diff/40001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/undo/drag_with_mutation_event_undo_order.html (right): https://codereview.chromium.org/2674173002/diff/40001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/undo/drag_with_mutation_event_undo_order.html:72: 'undo', On 2017/02/17 at 13:05:34, yosin_UTC9 wrote: > We don't need to check result of "undo" command, since functionality of "undo" is checked in other tests. > > The thing we want to verify this test is L80. So, verifying result of drag-and-drop and undo is "pre-condition" check. > > See comment in PS#4 of https://codereview.chromium.org/2685723005 This test check undo ordering. To make tests minimal and eliminate dependency, I'm going to check only the result of the first undo.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm https://codereview.chromium.org/2674173002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html (right): https://codereview.chromium.org/2674173002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html:30: document.execCommand('undo'); Do we have other test scripts want to check undo stack ordering? Do we want to expose "undo stack" via window.internals?
The CQ bit was checked by xiaochengh@chromium.org
Thanks for the review. https://codereview.chromium.org/2674173002/diff/60001/third_party/WebKit/Layo... File third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html (right): https://codereview.chromium.org/2674173002/diff/60001/third_party/WebKit/Layo... third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html:30: document.execCommand('undo'); On 2017/02/20 at 06:12:02, yosin_UTC9 wrote: > Do we have other test scripts want to check undo stack ordering? > Do we want to expose "undo stack" via window.internals? Guess your comment in the other patch means you are no longer a fan of this idea. So I'm committing.
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: cast_shell_linux on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromeos_amd64-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) chromium_presubmit on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL) linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
The CQ bit was checked by xiaochengh@chromium.org
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_tsan_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 xiaochengh@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": 60001, "attempt_start_ts": 1487779763507190,
"parent_rev": "7cec6d255cab4a76bcee44508c4d29622f5c933e", "commit_rev":
"91ce4c5c6b3c38b5291c94d897f691b30282cd79"}
Message was sent while issue was closed.
Description was changed from ========== Fix undo stack ordering for all-but-typing commands When one top-level editing command triggers another command via event handlers, Blink used to have their undo ordering reversed. The reason is that the enstacking of commands is not protected by EventQueueScope; consequently, the commands are executed in a nested manner, making the first command end later than the second command. This patch protects everything in CompositeEditCommand::apply with EventQueueScope, so that the nesting behavior for all commands (except TypingCommand) is eliminated. BUG=685975 TEST=editing/undo/drag_with_mutation_event_undo_order.html ========== to ========== Fix undo stack ordering for all-but-typing commands When one top-level editing command triggers another command via event handlers, Blink used to have their undo ordering reversed. The reason is that the enstacking of commands is not protected by EventQueueScope; consequently, the commands are executed in a nested manner, making the first command end later than the second command. This patch protects everything in CompositeEditCommand::apply with EventQueueScope, so that the nesting behavior for all commands (except TypingCommand) is eliminated. BUG=685975 TEST=editing/undo/drag_with_mutation_event_undo_order.html Review-Url: https://codereview.chromium.org/2674173002 Cr-Commit-Position: refs/heads/master@{#452095} Committed: https://chromium.googlesource.com/chromium/src/+/91ce4c5c6b3c38b5291c94d897f6... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/91ce4c5c6b3c38b5291c94d897f6... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
