blob: 6a998e33c45f9951f779b1e2ea4a32adae89f5e5 [file] [log] [blame]
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpEditingCallbacks();
</script>
<script>
function log(str) {
if (str == null)
str = "null"
var li = document.createElement("li");
var pre = document.createElement("pre");
pre.appendChild(document.createTextNode(str));
li.appendChild(pre);
var console = document.getElementById("console");
console.appendChild(li);
}
function runTest() {
var elem = document.getElementById("test");
var sel = window.getSelection();
if (window.testRunner)
window.testRunner.dumpAsText();
try {
sel.setBaseAndExtent(elem, 0, elem, 1);
var range = sel.getRangeAt(0);
log(range);
log(range.startContainer);
log(range.endContainer);
} catch(e) {
log("Error: " + e);
}
}
</script></head>
<body onload="runTest();">
<p>This tests that Selection::getRangeAt(int) returns a valid Range object.</p>
<div id="test" style="border:1px solid black; padding:1em;">hello</div>
<ul id="console"></ul>
</body>
</html>