blob: de35597aa7d2231801568affd8706e24b841fb74 [file] [log] [blame]
<html>
<head>
<style>
.editing {
border: 2px solid red;
font-size: 24px;
}
.explanation {
border: 2px solid blue;
padding: 12px;
font-size: 24px;
margin-bottom: 24px;
}
.scenario { margin-bottom: 16px;}
.scenario:first-line { font-weight: bold; margin-bottom: 16px;}
.expected-results:first-line { font-weight: bold }
</style>
<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
<script>
function editingTest() {
var t1 = document.getElementById("test1");
var t2 = document.getElementById("test2");
setSelectionCommand(t1, 0, t2, 3);
copyCommand();
var e = document.getElementById("target");
setSelectionCommand(e, 0, e, 1);
pasteCommand();
}
</script>
<title>Editing Test</title>
</head>
<body id="root" contenteditable>
<table><tr><td id="test1">hello</td><td id="test2">world</td></tr></table>
<div id="target">replaceme</div>
<script>
runEditingTest();
</script>
</body>
</html>