https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 1ae79efc01b050c482d7875c652c6577d735f324 authored by Boris Zbarsky on 28 March 2018, 19:09:05 UTC
part 2. Add a bunch of web platform tests for load and error events on stylesheet links.
Tip revision: 1ae79ef
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