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

Unified Diff: third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html

Issue 2674173002: Fix undo stack ordering for all-but-typing commands (Closed)
Patch Set: Minimize test Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html
diff --git a/third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html b/third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html
new file mode 100644
index 0000000000000000000000000000000000000000..79a61e6542c70ab47555abec5734f32dfacd3c17
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/undo/paste_with_mutation_event_undo_order.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<script>
+// Regression test for crbug.com/685975
+
+test(() => {
+ assert_not_equals(window.testRunner, undefined,
+ 'This test requires testRunner');
+
+ assert_selection(
+ [
+ '<div contenteditable id="div1">|</div>',
+ '<div contenteditable id="div2">bar</div>'
+ ].join(''),
+ selection => {
+ const document = selection.document;
+ const source = document.getElementById('source');
+ const div1 = document.getElementById('div1');
+ const div2 = document.getElementById('div2');
+ div1.addEventListener('DOMNodeInserted', () => {
+ div2.focus();
+ document.execCommand('selectAll');
+ document.execCommand('delete');
+ });
+
+ selection.setClipboardData('foo');
+ testRunner.execCommand('paste'); // Must be user-initiated paste.
+ document.execCommand('undo');
yosin_UTC9 2017/02/20 06:12:02 Do we have other test scripts want to check undo s
Xiaocheng 2017/02/22 02:36:20 Guess your comment in the other patch means you ar
+ },
+ [
+ '<div contenteditable id="div1">foo</div>',
+ '<div contenteditable id="div2">^bar|</div>'
+ ].join(''));
+}, 'Undo ordering maintained when pasting triggers another command with mutation event.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698