Source code
Revision control
Copy as Markdown
Other Tools
<!doctype html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>Test for painting caret before the last preformatted line break of the preformatted Text</title>
<style>
span[contenteditable] {
white-space: pre-wrap;
outline: none;
}
</style>
<script>
"use strict";
addEventListener("load", () => {
const editingHost = document.querySelector("span[contenteditable]");
editingHost.focus();
getSelection().collapse(editingHost.firstChild, editingHost.firstChild.length);
document.documentElement.removeAttribute("class");
}, {once: true});
</script>
</head>
<body>
<span contenteditable>ABC</span>
</body>
</html>