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

Side by Side Diff: tools/dom/templates/html/impl/impl_WheelEvent.darttemplate

Issue 23837003: Fixing wheel event on Dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 7 $(ANNOTATIONS)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
8 8
9 factory WheelEvent(String type, 9 factory WheelEvent(String type,
10 {Window view, int deltaX: 0, int deltaY: 0, 10 {Window view, int deltaX: 0, int deltaY: 0,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 detail = deltaY; 57 detail = deltaY;
58 axis = JS('int', 'MouseScrollEvent.VERTICAL_AXIS'); 58 axis = JS('int', 'MouseScrollEvent.VERTICAL_AXIS');
59 } else if (deltaX != 0) { 59 } else if (deltaX != 0) {
60 detail = deltaX; 60 detail = deltaX;
61 axis = JS('int', 'MouseScrollEvent.HORIZONTAL_AXIS'); 61 axis = JS('int', 'MouseScrollEvent.HORIZONTAL_AXIS');
62 } 62 }
63 event._initMouseScrollEvent(type, canBubble, cancelable, view, detail, 63 event._initMouseScrollEvent(type, canBubble, cancelable, view, detail,
64 screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, 64 screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
65 metaKey, button, relatedTarget, axis); 65 metaKey, button, relatedTarget, axis);
66 } else { 66 } else {
67 // Chrome does an auto-convert to pixels.
68 deltaY = deltaY ~/ 120;
67 $else 69 $else
68 // Dartium always needs these flipped because we're using the legacy 70 // Dartium always needs these flipped because we're using the legacy
69 // _initWebKitWheelEvent instead of the more modern WheelEvent constructor 71 // _initWebKitWheelEvent instead of the more modern WheelEvent constructor
70 // which isn't yet properly exposed by the Dartium bindings. 72 // which isn't yet properly exposed by the Dartium bindings.
71 deltaX = -deltaX; 73 deltaX = -deltaX;
72 deltaY = -deltaY; 74 deltaY = -deltaY;
73 $endif 75 $endif
74 // Fallthrough for Dartium. 76 // Fallthrough for Dartium.
75 event._initMouseEvent(type, canBubble, cancelable, view, detail, 77 event._initMouseEvent(type, canBubble, cancelable, view, detail,
76 screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, 78 screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey,
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 * [deltaMode]. 237 * [deltaMode].
236 * 238 *
237 * See also: 239 * See also:
238 * 240 *
239 * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html /DOM3-Events.html#events-WheelEvent-deltaY) from the W3C. 241 * * [WheelEvent.deltaY](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html /DOM3-Events.html#events-WheelEvent-deltaY) from the W3C.
240 */ 242 */
241 @DomName('WheelEvent.deltaY') 243 @DomName('WheelEvent.deltaY')
242 num get deltaY => _deltaY; 244 num get deltaY => _deltaY;
243 $endif 245 $endif
244 } 246 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698