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

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: Adding more dynamic checking for which init function to use. 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 024a891adaf86102af49fcf7f540b3e5f392d421..d7274e7c77009027e8214cbc2f3e80ea33953df7 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