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

Unified Diff: LayoutTests/fast/events/wheelevent-mousewheel-interaction.html

Issue 22859012: Add support for DOM Level 3 WheelEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename prefixedType() to legacyType() 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/events/wheelevent-mousewheel-interaction.html
diff --git a/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html b/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html
new file mode 100644
index 0000000000000000000000000000000000000000..687caef6d8d28ce3bb618a717e40fcb1cce2d0b6
--- /dev/null
+++ b/LayoutTests/fast/events/wheelevent-mousewheel-interaction.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="help" href="http://www.w3.org/TR/DOM-Level-3-Events/#events-WheelEvent">
+<script src="../js/resources/js-test-pre.js"></script>
+<script>
+function runTest() {
+ var div = document.getElementById('target');
+ div.addEventListener('wheel', wheelHandler);
+ div.addEventListener('mousewheel', mouseWheelHandler);
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(div.offsetLeft + 5, div.offsetTop + 5);
+ eventSender.mouseScrollBy(10, 20);
+ finishJSTest();
+ } else {
+ debug("FAIL: This test requires window.eventSender.");
+ finishJSTest();
+ }
+}
+
+var testEvent;
+function wheelHandler(e) {
+ testEvent = e;
+ testPassed("Standard wheel event was fired.");
+ shouldBe("testEvent.__proto__", "WheelEvent.prototype");
+}
+
+function mouseWheelHandler(e) {
+ testFailed("mousewheel event should not have fired.");
+}
+
+</script>
+</head>
+<body>
+<span id="parent">
+ <div id="target" style="border:solid 1px green; width:220px; height:70px; overflow:scroll">
+ TOP TOP TOP TOP TOP TOP TOP
+ Scroll mouse wheel over here
+ Scroll mouse wheel over here
+ Scroll mouse wheel over here
+ Scroll mouse wheel over here
+ Scroll mouse wheel over here
+ Scroll mouse wheel over here
+ END END END END END END END
+ </div>
+</span>
+<script>
+description("Tests the interaction between the standard 'wheel' event and the non-standard 'mousewheel' one");
+window.jsTestIsAsync = true;
+
+runTest();
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698