OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of dart.html; | 5 part of dart.html; |
6 | 6 |
7 /** | 7 /** |
8 * Helper class to implement custom events which wrap DOM events. | 8 * Helper class to implement custom events which wrap DOM events. |
9 * TODO(jacobr): consider using dart JsNative.$setInstanceInterceptor | 9 * TODO(jacobr): consider using dart JsNative.$setInstanceInterceptor |
10 * instead of using wrappers as that would allow passing these wrappers | 10 * instead of using wrappers as that would allow passing these wrappers |
11 * back through dispatchEvent unlike the current implementation. | 11 * back through dispatchEvent unlike the current implementation. |
12 * See https://github.com/dart-lang/sdk/issues/16869 | 12 * See https://github.com/dart-lang/sdk/issues/16869 |
13 */ | 13 */ |
14 class _WrappedEvent implements Event { | 14 class _WrappedEvent implements Event { |
15 /** Needed because KeyboardEvent is implements. | 15 /** Needed because KeyboardEvent is implements. |
16 */ | 16 */ |
17 final Event wrapped; | 17 final Event wrapped; |
18 | 18 |
19 /** The CSS selector involved with event delegation. */ | 19 /** The CSS selector involved with event delegation. */ |
20 String _selector; | 20 String _selector; |
21 | 21 |
22 _WrappedEvent(this.wrapped); | 22 _WrappedEvent(this.wrapped); |
23 | 23 |
24 bool get bubbles => wrapped.bubbles; | 24 bool get bubbles => wrapped.bubbles; |
25 | 25 |
26 bool get cancelable => wrapped.cancelable; | 26 bool get cancelable => wrapped.cancelable; |
27 | 27 |
28 EventTarget get currentTarget => wrapped.currentTarget; | 28 EventTarget get currentTarget => wrapped.currentTarget; |
29 | 29 |
| 30 List<EventTarget> deepPath() { |
| 31 return wrapped.deepPath(); |
| 32 } |
| 33 |
30 bool get defaultPrevented => wrapped.defaultPrevented; | 34 bool get defaultPrevented => wrapped.defaultPrevented; |
31 | 35 |
32 int get eventPhase => wrapped.eventPhase; | 36 int get eventPhase => wrapped.eventPhase; |
33 | 37 |
| 38 bool get isTrusted => wrapped.isTrusted; |
| 39 |
| 40 bool get scoped => wrapped.scoped; |
| 41 |
34 EventTarget get target => wrapped.target; | 42 EventTarget get target => wrapped.target; |
35 | 43 |
36 int get timeStamp => wrapped.timeStamp; | 44 double get timeStamp => wrapped.timeStamp; |
37 | 45 |
38 String get type => wrapped.type; | 46 String get type => wrapped.type; |
39 | 47 |
40 void _initEvent(String eventTypeArg, bool canBubbleArg, bool cancelableArg) { | 48 void _initEvent(String eventTypeArg, bool canBubbleArg, bool cancelableArg) { |
41 throw new UnsupportedError('Cannot initialize this Event.'); | 49 throw new UnsupportedError('Cannot initialize this Event.'); |
42 } | 50 } |
43 | 51 |
44 void preventDefault() { | 52 void preventDefault() { |
45 wrapped.preventDefault(); | 53 wrapped.preventDefault(); |
46 } | 54 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 * ## Other resources | 87 * ## Other resources |
80 * | 88 * |
81 * * [Shadow DOM extensions to | 89 * * [Shadow DOM extensions to |
82 * Event](http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-even
t) | 90 * Event](http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-even
t) |
83 * from W3C. | 91 * from W3C. |
84 */ | 92 */ |
85 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#ex
tensions-to-event | 93 // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#ex
tensions-to-event |
86 @Experimental() | 94 @Experimental() |
87 List<Node> get path => wrapped.path; | 95 List<Node> get path => wrapped.path; |
88 } | 96 } |
OLD | NEW |