mirror of
https://github.com/servo/servo.git
synced 2025-08-19 20:35:34 +01:00
Changed offset_to_text_point function and added unit tests for the same
This commit is contained in:
parent
1662fd7357
commit
7b58fb5fdd
5 changed files with 63 additions and 4 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue