haikuwebkit/LayoutTests/editing/deleting/delete-word-from-unstyled-d...

28 lines
728 B
HTML

<!DOCTYPE html>
<html>
<head>
<style>
.editing {
border: 2px solid red;
padding: 12px;
font-size: 24px;
}
</style>
<title>Editing Test</title>
</head>
<body contenteditable onload="runTest()">
<div id="test"><div>one<br>two</div></div>
</body>"
<script src="../../resources/dump-as-markup.js"></script>
<script>
function runTest() {
Markup.description('This test that the deletion of the last row of an unstyled DIV leaves a BR element and that the selection is where the BR element is.');
var element = document.getElementById("test").firstElementChild;
getSelection().setBaseAndExtent(element, 2, element, 3);
document.execCommand('delete');
Markup.dump('test');
}
</script>
</html>