3 <link rel="stylesheet" href="../js/resources/js-test-style.css">
4 <script src="../js/resources/js-test-pre.js"></script>
6 var givenScrollTop = 1;
7 var givenScrollLeft = 2;
8 var expectedScrollTop = 161;
9 var expectedScrollLeft = 322;
13 if (window.layoutTestController)
14 layoutTestController.waitUntilDone();
16 function dispatchWheelEvent()
18 var overflowElement = document.getElementById("overflow");
20 overflowElement.addEventListener("mousewheel", mousewheelHandler, false);
22 if (window.eventSender) {
23 eventSender.mouseMoveTo(100, 110);
24 eventSender.continuousMouseScrollBy(-window.givenScrollLeft, -window.givenScrollTop, true);
27 setTimeout('checkOffsets();', 100);
30 function checkOffsets()
32 div = document.getElementById("overflow");
33 shouldBe("div.scrollTop", "window.expectedScrollTop");
34 shouldBe("div.scrollLeft", "window.expectedScrollLeft");
36 if (window.layoutTestController)
37 window.layoutTestController.notifyDone();
40 function mousewheelHandler(e)
43 shouldBe("event.wheelDeltaY", "window.givenScrollTop * -3");
44 shouldBe("event.wheelDeltaX", "window.givenScrollLeft * -3");
47 shouldBe("event.wheelDelta", "window.givenScrollTop * -3");
49 shouldBe("event.wheelDelta", "window.givenScrollLeft * -3");
54 <body style="margin:0" onload="setTimeout('dispatchWheelEvent();', 100)">
55 <!-- This div is 200 pixels high. The content results in scrool bars on
56 both edges, resulting in an effective content area of 185 x 185 on
57 linux. The paging context overlap is 24 pixels. So one page of scroll
58 moves the content by 185 - 24 -= 161 pixels. -->
59 <div id="overflow" style="border:2px solid black;overflow:auto;height:200px;width:200px;">
60 <div style="height:300px;width:600px">
61 <div style="background-color:red;height:300px;width:300px;position:relative;left:0px;top:0px"></div>
62 <div style="background-color:green;height:300px;width:300px;position:relative;left:300px;top:-300px"></div>
64 <div style="height:300px;width:600px">
65 <div style="background-color:blue;height:300px;width:300px;position:relative;left:0px;top:0px"></div>
66 <div style="background-color:yellow;height:300px;width:300px;position:relative;left:300px;top:-300px"></div>
69 <div id="console"></div>