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

Unified Diff: third_party/WebKit/LayoutTests/editing/undo/redo-selection-modify-crash.html

Issue 2120223002: Make redo command not to set invalid selection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-07-04T15:06:28 Created 4 years, 5 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
Index: third_party/WebKit/LayoutTests/editing/undo/redo-selection-modify-crash.html
diff --git a/third_party/WebKit/LayoutTests/editing/undo/redo-selection-modify-crash.html b/third_party/WebKit/LayoutTests/editing/undo/redo-selection-modify-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..3b8980979c136d4ffd8c95c04e59374d744a28ee
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/undo/redo-selection-modify-crash.html
@@ -0,0 +1,22 @@
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../assert_selection.js"></script>
+<div id="log"></div>
+<script>
+test(() => {
+ assert_selection(
+ '<div contenteditable>|foo<br><i>bar</i></div>',
+ selection => {
+ // Make base/extent and start/end different.
+ selection.modify('extend', 'forward', 'word');
+ selection.document.execCommand('justifyLeft');
+ selection.document.execCommand('undo');
+ // Remove an anchor node for extent position of redo
+ selection.document.querySelector('i').remove();
+ selection.document.execCommand('redo');
+ },
+ navigator.platform.indexOf('Mac') == 0
+ ? '<div contenteditable>^foo|<br></div>'
+ : '<div contenteditable>^foo<br>|</div>');
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | third_party/WebKit/Source/core/editing/Editor.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698