Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1024)

Side by Side Diff: LayoutTests/fast/events/wheelevent-basic.html

Issue 22888005: WheelEvent's deltaX/deltaY sign is wrong (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/WheelEvent.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEven t"> 4 <link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEven t">
5 <script src="../js/resources/js-test-pre.js"></script> 5 <script src="../js/resources/js-test-pre.js"></script>
6 <script> 6 <script>
7 var deltaX = 10; 7 var deltaX = 10;
8 var deltaY = 120; 8 var deltaY = 120;
9 9
10 var testDiv; 10 var testDiv;
(...skipping 14 matching lines...) Expand all
25 eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5); 25 eventSender.mouseMoveTo(testDiv.offsetLeft + 5, testDiv.offsetTop + 5);
26 eventSender.mouseScrollBy(deltaX, deltaY); 26 eventSender.mouseScrollBy(deltaX, deltaY);
27 } else { 27 } else {
28 debug("FAIL: This test requires window.eventSender."); 28 debug("FAIL: This test requires window.eventSender.");
29 finishJSTest(); 29 finishJSTest();
30 } 30 }
31 } 31 }
32 32
33 var testEvent; 33 var testEvent;
34 var tickMultiplier = 120; 34 var tickMultiplier = 120;
35 var expectedDeltaX = deltaX * tickMultiplier; 35 var expectedDeltaX = -deltaX * tickMultiplier;
36 var expectedDeltaY = deltaY * tickMultiplier; 36 var expectedDeltaY = -deltaY * tickMultiplier;
37 function wheelHandler(e) { 37 function wheelHandler(e) {
38 testEvent = e; 38 testEvent = e;
39 shouldBe("testEvent.__proto__", "WheelEvent.prototype"); 39 shouldBe("testEvent.__proto__", "WheelEvent.prototype");
40 shouldBe("testEvent.__proto__.__proto__", "MouseEvent.prototype"); 40 shouldBe("testEvent.__proto__.__proto__", "MouseEvent.prototype");
41 shouldBe("testEvent.deltaX", "expectedDeltaX"); 41 shouldBe("testEvent.deltaX", "expectedDeltaX");
42 shouldBe("testEvent.deltaY", "expectedDeltaY"); 42 shouldBe("testEvent.deltaY", "expectedDeltaY");
43 shouldBe("testEvent.deltaZ", "0"); 43 shouldBe("testEvent.deltaZ", "0");
44 shouldBe("testEvent.deltaMode", "WheelEvent.DOM_DELTA_PIXEL") 44 shouldBe("testEvent.deltaMode", "WheelEvent.DOM_DELTA_PIXEL")
45 45
46 testDiv.removeEventListener("wheel", wheelHandler); 46 testDiv.removeEventListener("wheel", wheelHandler);
(...skipping 17 matching lines...) Expand all
64 </span> 64 </span>
65 <script> 65 <script>
66 description("Tests the basic functionality of the standard wheel event"); 66 description("Tests the basic functionality of the standard wheel event");
67 window.jsTestIsAsync = true; 67 window.jsTestIsAsync = true;
68 68
69 runTest(); 69 runTest();
70 </script> 70 </script>
71 <script src="../js/resources/js-test-post.js"></script> 71 <script src="../js/resources/js-test-post.js"></script>
72 </body> 72 </body>
73 </html> 73 </html>
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/WheelEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698