blob: 0e1a391622b7875085667c3d70ab7d5d6f3b1aa5 [file] [log] [blame]
<!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>