Skip to content

Commit

Permalink
Changed offset_to_text_point function and added unit tests for the same
Browse files Browse the repository at this point in the history
Upstreamed from servo/servo#19946 [ci skip]
  • Loading branch information
paavininanda authored and jdm committed Feb 7, 2018
1 parent 96ad348 commit eb127ab
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions selection/setSelectionRange.html
@@ -0,0 +1,18 @@
<!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>

0 comments on commit eb127ab

Please sign in to comment.