blob: 963dfda5c5f3a42be26ea30c3ec55476ade5e328 [file] [log] [blame]
This test checks if setSelectionRange(), selectionStart, and selectionEnd on a textarea and input work as expected. This includes checking edge cases such as out-of-bound values.
If this test passed you'll see a bunch of correct selection ranges below. Check the expected file for the correct ranges.
===textarea===
setSelectionRange():
3, 7
5, 5
42, 48
2, 2
selectionStart:
3, 3
7, 7
48, 48
48, 48
3, 48
selectionEnd:
3, 5
2, 2
2, 48
2, 48
7, 7
===input===
setSelectionRange():
3, 7
5, 5
42, 48
2, 2
selectionStart:
3, 3
7, 7
48, 48
48, 48
3, 48
selectionEnd:
3, 5
2, 2
2, 48
2, 48
7, 7
===button===
button.selectionStart did not throw exception
button.selectionStart = 0 threw exception
button.selectionEnd did not throw exception
button.selectionEnd = 0 threw exception
button.setSelectionRange defined
button.setSelectionRange(0,0) threw exception