Index: LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
diff --git a/LayoutTests/fast/events/wheelevent-in-scrolling-div.html b/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
index dbd8dc2e57d4af049e7360395192ff664a56d49b..e0cacc3e4b08f4a34f2d6fae9ab5cb0a75dfad27 100644 |
--- a/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
+++ b/LayoutTests/fast/events/wheelevent-in-scrolling-div.html |
@@ -16,9 +16,16 @@ |
if (overflowElement) { |
overflowElement.addEventListener("mousewheel", mousewheelHandler, false); |
- var wheelEvent = document.createEvent("WheelEvent"); |
- wheelEvent.initWebKitWheelEvent(-window.expectedScrollLeft, -window.expectedScrollTop, window, 0, 0, 0, 0, false, false, false, false); |
- overflowElement.dispatchEvent(wheelEvent); |
+ var deltaX = window.expectedScrollLeft; |
+ var deltaY = window.expectedScrollTop; |
+ var eventInit = { |
+ deltaX: deltaX, |
+ deltaY: deltaY, |
+ wheelDeltaX: -120 * deltaX, |
+ wheelDeltaY: -120 * deltaY, |
+ }; |
+ var event = new WheelEvent("mousewheel", eventInit); |
+ overflowElement.dispatchEvent(event); |
} |
setTimeout('checkOffsets();', 100); |
@@ -37,6 +44,8 @@ |
function mousewheelHandler(e) |
{ |
event = e; |
+ shouldBe("event.deltaY", "window.expectedScrollTop"); |
+ shouldBe("event.deltaX", "window.expectedScrollLeft"); |
shouldBe("event.wheelDeltaY", "window.expectedScrollTop*-120"); |
shouldBe("event.wheelDeltaX", "window.expectedScrollLeft*-120"); |