blob: 2a84d1898d9ba952428be4c44de8fb224e58c2f6 [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
0, 5
42, 48
2, 2
selectionStart:
3, 3
7, 7
0, 7
48, 48
3, 48
selectionEnd:
3, 5
2, 2
0, 0
0, 48
7, 7
===input===
setSelectionRange():
3, 7
0, 5
42, 48
2, 2
selectionStart:
3, 3
7, 7
0, 7
48, 48
3, 48
selectionEnd:
3, 5
2, 2
0, 0
0, 48
7, 7
===button===
button.selectionStart threw exception
button.selectionStart = 0 threw exception
button.selectionEnd threw exception
button.selectionEnd = 0 threw exception
button.setSelectionRange defined
button.setSelectionRange(0,0) threw exception