3 <script src=
"../../resources/js-test.js"></script>
5 var expectedScrollTop
= 200;
6 var expectedScrollLeft
= 100;
10 if (window
.testRunner
) {
11 testRunner
.waitUntilDone();
14 function dispatchWheelEvent()
16 var overflowElement
= document
.getElementById("overflow");
18 overflowElement
.addEventListener("mousewheel", mousewheelHandler
, false);
20 if (window
.eventSender
) {
21 eventSender
.mouseMoveTo(100, 110);
22 eventSender
.continuousMouseScrollBy(-window
.expectedScrollLeft
, -window
.expectedScrollTop
);
25 setTimeout('checkOffsets();', 100);
28 function checkOffsets()
30 div
= document
.getElementById("overflow");
31 shouldBe("div.scrollTop", "window.expectedScrollTop");
32 shouldBe("div.scrollLeft", "window.expectedScrollLeft");
34 if (window
.testRunner
)
35 window
.testRunner
.notifyDone();
38 function mousewheelHandler(e
)
41 shouldBe("event.wheelDeltaY", "window.expectedScrollTop*-3");
42 shouldBe("event.wheelDeltaX", "window.expectedScrollLeft*-3");
45 shouldBe("event.wheelDelta", "window.expectedScrollTop*-3");
47 shouldBe("event.wheelDelta", "window.expectedScrollLeft*-3");
52 <body style=
"margin:0" onload=
"setTimeout('dispatchWheelEvent();', 100)">
53 <div id=
"overflow" style=
"border:2px solid black;overflow:auto;height:200px;width:200px;">
54 <div style=
"background-color:red;height:200px;width:400px;"></div>
55 <div style=
"background-color:green;height:200px;width:400px;"></div>
56 <div style=
"background-color:red;height:200px;width:400px;"></div>
58 <div id=
"console"></div>