6 <p>Test that click events are fired for a slider when the range of values is dense enough that the thumb element is repositioned under the cursor on mouse press.
</p>
9 <input id=
"slider" type=
"range" min=
"0" max=
"100" value=
"50"></input>
10 <pre id=
"console"></pre>
11 <script src=
"../../resources/js-test.js"></script>
21 window
.onload = function()
23 if (!window
.testRunner
)
26 slider
= document
.getElementById("slider");
27 slider
.addEventListener("click", onClick
);
29 // Click respositions the slider thumb element under the cursor.
30 // Ensure that the click event still fires.
31 var x
= slider
.offsetLeft
+ 1;
32 var y
= slider
.offsetTop
+ slider
.clientHeight
/ 2;
34 eventSender
.mouseMoveTo(x
, y
);
35 eventSender
.mouseDown();
36 eventSender
.mouseUp();
38 eventSender
.mouseMoveTo(x
+ slider
.clientWidth
- 2, y
);
39 eventSender
.mouseDown();
40 eventSender
.mouseUp();
42 eventSender
.mouseMoveTo(x
+ slider
.clientWidth
/ 2, y
);
43 eventSender
.mouseDown();
44 eventSender
.mouseUp();
46 shouldBe("clickCount", "3");