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

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

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:
Download patch
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 adc5b0e63c457ac6934ca8fb365dfcb3e65b0823..4ae6afa888827e87a383c592102469eb99b09ac6 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -11984,10 +11984,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) {
+ var hasWebkit = webkitEvents[type.toLowerCase()].startsWith('webkit');
+ if (hasWebkit && Device.isWebKit) {
+ return new _ElementEventStreamImpl(
+ _ptr, webkitEvents[type.toLowerCase()], false);
+ }
+ }
return new _ElementEventStreamImpl(_ptr, type, false);
}
}
@@ -35336,6 +35359,8 @@ class _Utils {
static bool isMap(obj) => obj is Map;
+ static List toListIfIterable(obj) => obj is Iterable ? obj.toList() : null;
+
static Map createMap() => {};
static makeUnimplementedError(String fileName, int lineNo) {
@@ -35642,10 +35667,6 @@ class _Utils {
static bool isNoSuchMethodError(obj) => obj is NoSuchMethodError;
- // TODO(jacobr): we need a failsafe way to determine that a Node is really a
- // DOM node rather than just a class that extends Node.
- static bool isNode(obj) => obj is Node;
-
static bool _isBuiltinType(ClassMirror cls) {
// TODO(vsm): Find a less hackish way to do this.
LibraryMirror lib = cls.owner;

Powered by Google App Engine
This is Rietveld 408576698