https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 81aaac8299a4608b990ab472a89a522cdeeb29f7 authored by Geoffrey Sneddon on 30 April 2018, 15:11:48 UTC
fixup! Fix #2669: Add alternate_hosts
Tip revision: 81aaac8
setSelectionRange.html
<!doctype html>
<meta charset="utf-8">
<title></title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<textarea>

</textarea>
<script>
test(function() {
    let textarea = document.querySelector('textarea');
    assert_equals(textarea.selectionStart, 0);
    assert_equals(textarea.selectionEnd, 0);
    textarea.setSelectionRange(0, 1);
    assert_equals(textarea.selectionStart, 0);
    assert_equals(textarea.selectionEnd, 1);
}, "setSelectionRange on line boundaries");
</script>
back to top