| OLD | NEW |
| 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 // WARNING: Do not edit - generated code. | 5 // WARNING: Do not edit - generated code. |
| 6 | 6 |
| 7 part of $LIBRARYNAME; | 7 part of $LIBRARYNAME; |
| 8 | 8 |
| 9 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { | 9 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { |
| 10 // In JS, canBubble and cancelable are technically required parameters to | 10 // In JS, canBubble and cancelable are technically required parameters to |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * | 27 * |
| 28 * var e = new Event.type('MouseEvent', 'mousedown', true, true); | 28 * var e = new Event.type('MouseEvent', 'mousedown', true, true); |
| 29 */ | 29 */ |
| 30 factory Event.eventType(String type, String name, {bool canBubble: true, | 30 factory Event.eventType(String type, String name, {bool canBubble: true, |
| 31 bool cancelable: true}) { | 31 bool cancelable: true}) { |
| 32 final Event e = document.$dom_createEvent(type); | 32 final Event e = document.$dom_createEvent(type); |
| 33 e.$dom_initEvent(name, canBubble, cancelable); | 33 e.$dom_initEvent(name, canBubble, cancelable); |
| 34 return e; | 34 return e; |
| 35 } | 35 } |
| 36 $!MEMBERS | 36 $!MEMBERS |
| 37 | |
| 38 /** | |
| 39 * Checks to see if the event class is supported by the current platform. | |
| 40 */ | |
| 41 static bool _isTypeSupported(String eventType) { | |
| 42 // Browsers throw for unsupported event names. | |
| 43 try { | |
| 44 var e = document.$dom_createEvent(eventType); | |
| 45 return e is Event; | |
| 46 } catch (_) { } | |
| 47 return false; | |
| 48 } | |
| 49 } | 37 } |
| OLD | NEW |