3 <script src=
"../../resources/js-test.js"></script>
5 var givenScrollTop
= 2;
6 var givenScrollLeft
= 0;
7 var expectedScrollTop
= 0;
8 var expectedScrollLeft
= 0;
12 if (window
.testRunner
)
13 testRunner
.waitUntilDone();
15 function dispatchWheelEvent()
17 document
.body
.addEventListener("mousewheel", mousewheelHandler
, false);
19 if (window
.eventSender
) {
20 eventSender
.mouseMoveTo(100, 110);
21 eventSender
.continuousMouseScrollBy(-window
.givenScrollLeft
, -window
.givenScrollTop
, true);
24 setTimeout('checkOffsets();', 100);
27 function checkOffsets()
29 shouldBe("document.scrollingElement.scrollTop", "window.expectedScrollTop");
30 shouldBe("document.scrollingElement.scrollLeft", "window.expectedScrollLeft");
32 if (window
.testRunner
)
33 window
.testRunner
.notifyDone();
36 function mousewheelHandler(e
)
39 shouldBe("event.wheelDeltaY", "window.givenScrollTop * -3");
40 shouldBe("event.wheelDeltaX", "0");
43 shouldBe("event.wheelDelta", "window.givenScrollTop * -3");
45 shouldBe("event.wheelDelta", "0");
50 <body style=
"margin:0" onload=
"setTimeout('dispatchWheelEvent();', 100)">
51 <div style=
"height:200px;width:2400px">
52 <div style=
"background-color:red;height:200px;width:1200px;position:relative;left:0px;top:0px"></div>
53 <div style=
"background-color:green;height:200px;width:1200px;position:relative;left:1200px;top:-200px"></div>
55 <div style=
"height:200px;width:2400px">
56 <div style=
"background-color:blue;height:200px;width:1200px;position:relative;left:0px;top:0px"></div>
57 <div style=
"background-color:yellow;height:200px;width:1200px;position:relative;left:1200px;top:-200px"></div>
59 <div id=
"console"></div>