4 <link rel=
"help" href=
"http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent">
5 <script src=
"../../resources/js-test.js"></script>
8 var div
= document
.getElementById('target');
9 div
.addEventListener('wheel', wheelHandler
);
10 div
.addEventListener('mousewheel', mouseWheelHandler
);
11 if (window
.eventSender
) {
12 eventSender
.mouseMoveTo(div
.offsetLeft
+ 5, div
.offsetTop
+ 5);
13 eventSender
.mouseScrollBy(10, 20);
16 debug("FAIL: This test requires window.eventSender.");
22 function wheelHandler(e
) {
24 testPassed("Standard wheel event was fired.");
25 shouldBe("testEvent.__proto__", "WheelEvent.prototype");
28 function mouseWheelHandler(e
) {
29 testFailed("mousewheel event should not have fired.");
36 <div id=
"target" style=
"border:solid 1px green; width:220px; height:70px; overflow:scroll">
37 TOP TOP TOP TOP TOP TOP TOP
38 Scroll mouse wheel over here
39 Scroll mouse wheel over here
40 Scroll mouse wheel over here
41 Scroll mouse wheel over here
42 Scroll mouse wheel over here
43 Scroll mouse wheel over here
44 END END END END END END END
48 description("Tests the interaction between the standard 'wheel' event and the non-standard 'mousewheel' one");
49 window
.jsTestIsAsync
= true;