3 <link rel="stylesheet" href="../js/resources/js-test-style.css">
4 <script src="../js/resources/js-test-pre.js"></script>
6 var givenScrollTop = 0;
7 var givenScrollLeft = 2; // When paging, this is ignored. Every event is one page.
8 var expectedScrollTop = 0;
9 var expectedScrollLeft = 700; // Window is 800x600. Scroll 87.5% of visible.
13 if (window.layoutTestController)
14 layoutTestController.waitUntilDone();
16 function dispatchWheelEvent()
18 document.body.addEventListener("mousewheel", mousewheelHandler, false);
20 if (window.eventSender) {
21 eventSender.mouseMoveTo(100, 110);
22 eventSender.continuousMouseScrollBy(-window.givenScrollLeft, -window.givenScrollTop, true);
25 setTimeout('checkOffsets();', 100);
28 function checkOffsets()
30 shouldBe("document.body.scrollTop", "window.expectedScrollTop");
31 shouldBe("document.body.scrollLeft", "window.expectedScrollLeft");
33 if (window.layoutTestController)
34 window.layoutTestController.notifyDone();
37 function mousewheelHandler(e)
40 shouldBe("event.wheelDeltaY", "0");
41 shouldBe("event.wheelDeltaX", "window.givenScrollLeft * -3");
44 shouldBe("event.wheelDelta", "0");
46 shouldBe("event.wheelDelta", "window.givenScrollLeft * -3");
51 <body style="margin:0;padding:0" onload="setTimeout('dispatchWheelEvent();', 100)">
52 <div style="margin:0;padding:0;height:200px;width:2400px">
53 <div style="margin:0;padding:0;background-color:red;height:200px;width:1200px;position:relative;left:0px;top:0px"></div>
54 <div style="margin:0;padding:0;background-color:green;height:200px;width:1200px;position:relative;left:1200px;top:-200px"></div>
56 <div style="margin:0;padding:0;height:200px;width:2400px">
57 <div style="margin:0;padding:0;background-color:blue;height:200px;width:1200px;position:relative;left:0px;top:0px"></div>
58 <div style="margin:0;padding:0;background-color:yellow;height:200px;width:1200px;position:relative;left:1200px;top:-200px"></div>
60 <div id="console"></div>