| <!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> |