5 document
.getElementById('res').innerHTML
= document
.getElementById('res').innerHTML
+ msg
+ "<br>";
10 testRunner
.dumpAsText();
11 var tf
= document
.getElementById('tf');
13 log('Calling focus on text field');
15 log('After focus: text field selection start: ' + tf
.selectionStart
+ ' end: ' + tf
.selectionEnd
+ '<br>');
17 log('Calling setSelectionRange on text field');
18 tf
.setSelectionRange(3, 5);
19 log('After setSelectionRange(3, 5): text field selection start: ' + tf
.selectionStart
+ ' end: ' + tf
.selectionEnd
+ '<br>');
21 log('Double clicking to make selection for text field');
22 if (window
.eventSender
) {
23 eventSender
.mouseMoveTo(60, 55);
24 eventSender
.mouseDown();
25 eventSender
.mouseUp();
26 eventSender
.mouseDown();
27 eventSender
.mouseUp();
29 log('After double clicking: text field selection start: ' + tf
.selectionStart
+ ' end: ' + tf
.selectionEnd
+ '<br>');
31 log('Calling blur on text field');
33 log('After blur: text field selection start: ' + tf
.selectionStart
+ ' end: ' + tf
.selectionEnd
+ '<br>');
35 log('Calling focus on text field');
37 log('After focus: text field selection start: ' + tf
.selectionStart
+ ' end: ' + tf
.selectionEnd
);
41 <body onload=
"test()"><br>
42 This tests onSelect for text fields.
<br><br>
43 <input type=
"text" id=
"tf" onselect=
"log('onselect fired for text field');" style=
"position: absolute; top: 50; left: 10;" value=
"input text"></input>
44 <div id=
"res" style=
"position: absolute; top: 100; left: 10;"></div>