4 textarea { -webkit-appearance: textarea;}
8 document
.getElementById('res').innerHTML
= document
.getElementById('res').innerHTML
+ msg
+ "<br>";
12 if (window
.testRunner
)
13 testRunner
.dumpAsText();
14 var ta
= document
.getElementById('ta');
16 log('Calling focus on textarea');
18 log('After focus: textarea selection start: ' + ta
.selectionStart
+ ' end: ' + ta
.selectionEnd
+ '<br>');
20 log('Calling setSelectionRange on textarea');
21 ta
.setSelectionRange(5, 10);
22 log('After setSelectionRange(5, 10): textarea selection start: ' + ta
.selectionStart
+ ' end: ' + ta
.selectionEnd
+ '<br>');
24 log('Double clicking to make selection for textarea');
25 if (window
.eventSender
) {
26 eventSender
.mouseMoveTo(75, 55);
27 eventSender
.mouseDown();
28 eventSender
.mouseUp();
29 eventSender
.mouseDown();
30 eventSender
.mouseUp();
32 log('After double clicking: textarea selection start: ' + ta
.selectionStart
+ ' end: ' + ta
.selectionEnd
+ '<br>');
34 log('Calling blur on textarea');
36 log('After blur: textarea selection start: ' + ta
.selectionStart
+ ' end: ' + ta
.selectionEnd
+ '<br>');
38 log('Calling focus on textarea');
40 log('After focus: textarea selection start: ' + ta
.selectionStart
+ ' end: ' + ta
.selectionEnd
);
44 <body onload=
"test()">
46 This tests onSelect for textareas.
<br>
47 This also makes sure that the correct selection is restored when the element regains focus.
<br><br>
48 <textarea id=
"ta" onselect=
"log('onselect fired for textarea');" style=
"position: absolute; top: 50; left: 10;">textarea with lots of fun content!
</textarea>
49 <div id=
"res" style=
"position: absolute; top: 100; left: 10;"></div>