4 <script src=
"../../../resources/js-test.js"></script>
5 <select id=
"select1" multiple
size=
"4">
17 description('Click on a listbox scrollbar should not dispatch change evnet.');
19 var select1
= document
.getElementById('select1');
20 var changeEventCounter
= 0;
21 select1
.onchange = function() {
22 debug('A change event was dispatched.');
26 window
.onload = function() {
27 if (!window
.eventSender
)
28 debug('Click on the scrollbar. The test passes if nothing is printed.');
30 eventSender
.mouseMoveTo(select1
.offsetLeft
+ select1
.offsetWidth
- 2, select1
.offsetTop
+ select1
.offsetHeight
- 2);
31 eventSender
.mouseDown();
32 eventSender
.mouseUp();
33 shouldBe('select1.selectedIndex', '-1');
34 shouldBe('changeEventCounter', '0');
37 debug('Dispatch a change evnet to prepare the next test.');
38 eventSender
.mouseMoveTo(select1
.offsetLeft
+ 4, select1
.offsetTop
+ 4);
39 eventSender
.mouseDown();
40 eventSender
.mouseUp();
41 shouldBe('changeEventCounter', '1');
42 debug('Change the option list size, and click the scrollbar again.');
43 select1
.appendChild(new Option("9"));
44 eventSender
.mouseMoveTo(select1
.offsetLeft
+ select1
.offsetWidth
- 2, select1
.offsetTop
+ select1
.offsetHeight
- 2);
45 eventSender
.mouseDown();
46 eventSender
.mouseUp();
47 shouldBe('changeEventCounter', '1');