blob: 4caa6cf7f26c543fe94f158ea7b784a0a64882df [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script>
(() => {
addEventListener("input", () => { });
addEventListener("DOMContentLoaded", () => {
let editor = document.getElementById("editor");
function render() {
mutationObserver.disconnect();
editor.innerHTML = editor.innerHTML;
getSelection().collapse(editor.firstElementChild, 1);
mutationObserver.observe(editor, {
childList: true,
attributes: true,
characterData: true,
subtree: true
});
}
var mutationObserver = new MutationObserver(render);
editor.focus();
render();
function typeNewlines(remaining) {
if (!eventSender)
return;
eventSender.keyDown("\n", []);
if (remaining == 0)
testRunner.notifyDone();
else {
setTimeout(() => {
typeNewlines(remaining - 1);
}, 100);
}
}
typeNewlines(3);
});
})();
</script>
</head>
<body>
<div id="editor" contenteditable><div><br></div></div>
<div>To manually test this, press enter multiple times in the editable area. Newlines should be inserted.</div>
</body>
<script>
testRunner.dumpAsText();
testRunner.waitUntilDone();
</script>
</html>