3 <script src=
"../../resources/js-test.js"></script>
5 var givenScrollTop
= 1;
6 var givenScrollLeft
= 2;
7 var expectedScrollTop
= 161;
8 var expectedScrollLeft
= 322;
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", "window.givenScrollTop * -3");
43 shouldBe("event.wheelDeltaX", "window.givenScrollLeft * -3");
46 shouldBe("event.wheelDelta", "window.givenScrollTop * -3");
48 shouldBe("event.wheelDelta", "window.givenScrollLeft * -3");
53 <body style=
"margin:0" onload=
"setTimeout('dispatchWheelEvent();', 100)">
54 <!-- This div is 200 pixels high. The content results in scrool bars on
55 both edges, resulting in an effective content area of 185 x 185 on
56 linux. The paging context overlap is 24 pixels. So one page of scroll
57 moves the content by 185 - 24 -= 161 pixels. -->
58 <div id=
"overflow" style=
"border:2px solid black;overflow:auto;height:200px;width:200px;">
59 <div style=
"height:300px;width:600px">
60 <div style=
"background-color:red;height:300px;width:300px;position:relative;left:0px;top:0px"></div>
61 <div style=
"background-color:green;height:300px;width:300px;position:relative;left:300px;top:-300px"></div>
63 <div style=
"height:300px;width:600px">
64 <div style=
"background-color:blue;height:300px;width:300px;position:relative;left:0px;top:0px"></div>
65 <div style=
"background-color:yellow;height:300px;width:300px;position:relative;left:300px;top:-300px"></div>
68 <div id=
"console"></div>