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

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

Issue 29843004: Allow all events to be accessed via on[foo] instead of just onFoo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_EventTarget.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
index 1630878110b9cb4978c19215865912a37fe98437..9f6872063d80d57b12517aa65fcf38f9734ed93f 100644
--- a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
+++ b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
@@ -54,10 +54,33 @@ class Events {
class ElementEvents extends Events {
/* Raw event target. */
final Element _ptr;
+ static final webkitEvents = {
+ 'animationend' : 'webkitAnimationEnd',
+ 'animationiteration' : 'webkitAnimationIteration',
+ 'animationstart' : 'webkitAnimationStart',
+ 'fullscreenchange' : 'webkitfullscreenchange',
+ 'fullscreenerror' : 'webkitfullscreenerror',
+ 'keyadded' : 'webkitkeyadded',
+ 'keyerror' : 'webkitkeyerror',
+ 'keymessage' : 'webkitkeymessage',
+ 'needkey' : 'webkitneedkey',
+ 'pointerlockchange' : 'webkitpointerlockchange',
+ 'pointerlockerror' : 'webkitpointerlockerror',
+ 'resourcetimingbufferfull' : 'webkitresourcetimingbufferfull',
+ 'transitionend': 'webkitTransitionEnd',
+ 'speechchange' : 'webkitSpeechChange'
+ };
ElementEvents(Element ptr) : this._ptr = ptr, super(ptr);
Stream operator [](String type) {
+ if (type.toLowerCase() in webkitEvents.keys) {
blois 2013/10/21 22:57:59 types are case-sensitive, toLowerCase should not b
+ var hasWebkit = webkitEvents[type.toLowerCase()].startsWith('webkit');
blois 2013/10/21 22:57:59 are any of these not webkit?
+ if (hasWebkit && Device.isWebKit) {
+ return new _ElementEventStreamImpl(
+ _ptr, webkitEvents[type.toLowerCase()], false);
+ }
+ }
return new _ElementEventStreamImpl(_ptr, type, false);
}
}
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698