| Index: third_party/WebKit/LayoutTests/editing/undo/redo_correct_selection.html
|
| diff --git a/third_party/WebKit/LayoutTests/editing/undo/redo_correct_selection.html b/third_party/WebKit/LayoutTests/editing/undo/redo_correct_selection.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0e1a391622b7875085667c3d70ab7d5d6f3b1aa5
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/editing/undo/redo_correct_selection.html
|
| @@ -0,0 +1,31 @@
|
| +<!doctype html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script src="../assert_selection.js"></script>
|
| +<script>
|
| +test(() => assert_selection(
|
| + '<div contenteditable>^012<select></select>|</div><option></option>',
|
| + selection => {
|
| + const div = selection.document.querySelector('div');
|
| + let currentCommand = '';
|
| + function execCommand(name) {
|
| + currentCommand = name;
|
| + selection.document.execCommand(name);
|
| + }
|
| + // Move SELECT into OPTION before calling |FrameSelection::setSelection()|
|
| + // in |Editor::reappliedEditing()|.
|
| + div.addEventListener('webkitEditableContentChanged', () => {
|
| + if (currentCommand !== 'redo')
|
| + return;
|
| + const div = selection.document.querySelector('div');
|
| + const select = selection.document.querySelector('select');
|
| + const option = selection.document.querySelector('option');
|
| + option.appendChild(select);
|
| + });
|
| + execCommand('bold');
|
| + execCommand('undo');
|
| + execCommand('redo');
|
| + },
|
| + '<div contenteditable><b>^012|</b></div><option><select></select></option>'),
|
| + 'Redo command should update selection');
|
| +</script>
|
|
|