3 <script src=
"../../resources/js-test.js"></script>
6 <input id=
"input" type=
"text" value=
"something">
7 <input id=
"readonlyInput" type=
"text" readonly
value=
"something">
8 <input id=
"disabledInput" type=
"text" disabled
value=
"something">
10 <textarea id=
"textarea">something
</textarea>
11 <textarea id=
"readonlyTextarea" readonly
>something
</textarea>
12 <textarea id=
"disabledTextarea" disabled
>something
</textarea>
14 <pre id=
"console"></pre>
17 function doubleClickOn(element
)
19 var x
= element
.offsetLeft
+ element
.offsetWidth
/ 2;
20 var y
= element
.offsetTop
+ element
.offsetHeight
/ 2;
22 eventSender
.mouseMoveTo(x
, y
);
23 eventSender
.mouseDown();
24 eventSender
.mouseUp();
25 eventSender
.mouseDown();
26 eventSender
.mouseUp();
29 var selectEventFiredOnInput
= false;
30 var selectEventFiredOnReadonlyInput
= false;
31 var selectEventFiredOnDisabledInput
= false;
32 var selectEventFiredOnTextarea
= false;
33 var selectEventFiredOnReadonlyTextarea
= false;
34 var selectEventFiredOnDisabledTextarea
= false;
36 input
.addEventListener('select', function() {
37 selectEventFiredOnInput
= true;
39 readonlyInput
.addEventListener('select', function() {
40 selectEventFiredOnReadonlyInput
= true;
42 disabledInput
.addEventListener('select', function() {
43 selectEventFiredOnDisabledInput
= true;
46 textarea
.addEventListener('select', function() {
47 selectEventFiredOnTextarea
= true;
49 readonlyTextarea
.addEventListener('select', function() {
50 selectEventFiredOnReadonlyTextarea
= true;
52 disabledTextarea
.addEventListener('select', function() {
53 selectEventFiredOnDisabledTextarea
= true;
56 debug('double clicking on normal input');
58 shouldBeTrue('selectEventFiredOnInput');
61 debug('double clicking on readonly input');
62 doubleClickOn(readonlyInput
);
63 shouldBeTrue('selectEventFiredOnReadonlyInput');
66 debug('double clicking on disabled input');
67 doubleClickOn(disabledInput
);
68 shouldBeTrue('selectEventFiredOnDisabledInput');
71 debug('double clicking on normal textarea');
72 doubleClickOn(textarea
);
73 shouldBeTrue('selectEventFiredOnTextarea');
76 debug('double clicking on readonly textarea');
77 doubleClickOn(readonlyTextarea
);
78 shouldBeTrue('selectEventFiredOnReadonlyTextarea');
81 debug('double clicking on disabled textarea');
82 doubleClickOn(disabledTextarea
);
83 shouldBeTrue('selectEventFiredOnDisabledTextarea');
86 container
.innerHTML
= "";