3 <script src=
"../../resources/js-test.js"></script>
5 var givenScrollTop
= 0;
6 var givenScrollLeft
= 2;
7 var expectedScrollTop
= 0;
8 var expectedScrollLeft
= 0;
12 if (window
.testRunner
)
13 testRunner
.waitUntilDone();
15 function dispatchWheelEvent()
17 var overflowElement
= document
.getElementById("overflow");
19 overflowElement
.addEventListener("mousewheel", mousewheelHandler
, false);
21 if (window
.eventSender
) {
22 eventSender
.mouseMoveTo(100, 110);
23 eventSender
.continuousMouseScrollBy(-window
.givenScrollLeft
, -window
.givenScrollTop
, true);
26 setTimeout('checkOffsets();', 100);
29 function checkOffsets()
31 div
= document
.getElementById("overflow");
32 shouldBe("div.scrollTop", "window.expectedScrollTop");
33 shouldBe("div.scrollLeft", "window.expectedScrollLeft");
35 if (window
.testRunner
)
36 window
.testRunner
.notifyDone();
39 function mousewheelHandler(e
)
42 shouldBe("event.wheelDeltaY", "0");
43 shouldBe("event.wheelDeltaX", "window.givenScrollLeft*-3");
46 shouldBe("event.wheelDelta", "0");
48 shouldBe("event.wheelDelta", "window.givenScrollLeft*-3");
53 <body style=
"margin:0" onload=
"setTimeout('dispatchWheelEvent();', 100)">
54 <div id=
"overflow" style=
"border:2px solid black;overflow:auto;height:200px;width:200px;">
55 <div style=
"border:0px;background-color:red;height:300px;width:185px;"></div>
56 <div style=
"border:0px;background-color:green;height:300px;width:185px;"></div>
58 <div id=
"console"></div>