blob: 2bf16551c14d57edb13f363fd2c6b4da61b2e7cc [file] [log] [blame]
<!DOCTYPE html><!-- webkit-test-runner [ enableEditableImages=true ] -->
<head>
<script src="../../resources/dump-as-markup.js" type="text/javascript"></script>
</head>
<body contenteditable>
<div id="test">Hello, world!</div>
<script>
const div = document.getElementById("test");
window.getSelection().setPosition(div, 13);
document.execCommand("InsertEditableImage");
Markup.description("This test inserts a editable image, performs an undo, then a redo, ensuring that the selection remains after the image when re-done.")
Markup.dump(div, "before undo");
document.execCommand('undo', false, null);
Markup.dump(div, "after undo");
document.execCommand('redo', false, null);
Markup.dump(div, "after redo");
</script>
</body>