blob: 76232b25f048668b76ecd5f2b23c3a49c2c60a3c [file] [log] [blame]
<div id="target">All of this should be selected</div><div>None of this should be selected.</div>
<p id="result"></p>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var target = document.getElementById("target");
var result = document.getElementById("result");
var sel = getSelection();
sel.setBaseAndExtent(target, 0, target, 1);
sel.modify("extend", "forward", "sentence");
var selectedText = sel.toString().trim();
if (selectedText == "All of this should be selected") {
result.innerText = "PASS";
} else {
result.innerText = "FAIL: Selected range is '" + selectedText + "'";
}
</script>