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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 13571003: Re-try of Flipping the direction of WheelEvent.deltaX/Y to follow standards (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes for Dartium and Firefox Created 7 years, 8 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:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_WheelEvent.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 5f621fc69fe992f920b7bf6a2782c94667d8eb2e..596fbf828dd754012b1025b403bd2d08f9e4322e 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -26888,6 +26888,10 @@ class WheelEvent extends MouseEvent {
eventType = 'MouseScrollEvents';
}
final event = document.$dom_createEvent(eventType);
+ // Dartium always needs these flipped because we're essentially always
+ // polyfilling (see similar dart2js code as well)
+ deltaX = -deltaX;
+ deltaY = -deltaY;
// Fallthrough for Dartium.
event.$dom_initMouseEvent(type, canBubble, cancelable, view, detail,
screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
@@ -26932,10 +26936,27 @@ class WheelEvent extends MouseEvent {
void $dom_initWebKitWheelEvent(int wheelDeltaX, int wheelDeltaY, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native "WheelEvent_initWebKitWheelEvent_Callback";
+ /**
+ * The amount that is expected to scroll horizontally, in units determined by
+ * [deltaMode].
+ *
+ * See also:
+ *
+ * * [WheelEvent.deltaX](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaX) from the W3C.
+ */
@DomName('WheelEvent.deltaX')
- num get deltaX => $dom_wheelDeltaX;
+ num get deltaX => -$dom_wheelDeltaX;
+
+ /**
+ * The amount that is expected to scroll vertically, in units determined by
+ * [deltaMode].
+ *
+ * See also:
+ *
+ * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
+ */
@DomName('WheelEvent.deltaY')
- num get deltaY => $dom_wheelDeltaY;
+ num get deltaY => -$dom_wheelDeltaY;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_WheelEvent.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698