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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 11931009: Adding support for the MouseWheel event in Streams. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index bd3f1c824301ac097dd8b65637751bd94d43f048..557c4206b564a62ac8c869199e6b4d866ea72c48 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -727,6 +727,23 @@ $endif
var xtag;
$if DART2JS
+ static const EventStreamProvider<WheelEvent> mouseWheelEvent =
+ const _CustomEventStreamProvider<WheelEvent>(
+ Element._determineMouseWheelEventType);
+
+ static String _determineMouseWheelEventType(EventTarget e) {
+ if (JS('bool', '#.onwheel !== undefined', e)) {
+ // W3C spec, and should be IE9+, but IE has a bug exposing onwheel.
+ return 'wheel';
+ } else if (JS('bool', '#.onmousewheel !== undefined', e)) {
+ // Chrome & IE
+ return 'mousewheel';
+ } else {
+ // Firefox
+ return 'DOMMouseScroll';
+ }
+ }
+
/**
* Creates a text node and inserts it into the DOM at the specified location.
*

Powered by Google App Engine
This is Rietveld 408576698