| 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 html; | 5 part of html; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Adapter for exposing DOM events as Dart streams. | 8 * Adapter for exposing DOM events as Dart streams. |
| 9 */ | 9 */ |
| 10 class _EventStream<T extends Event> extends Stream<T> { | 10 class _EventStream<T extends Event> extends Stream<T> { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 Stream<T> matches(String selector); | 42 Stream<T> matches(String selector); |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * Adds a capturing subscription to this stream. | 45 * Adds a capturing subscription to this stream. |
| 46 * | 46 * |
| 47 * If the target of the event is a descendant of the element from which this | 47 * If the target of the event is a descendant of the element from which this |
| 48 * stream derives then [onData] is called before the event propagates down to | 48 * stream derives then [onData] is called before the event propagates down to |
| 49 * the target. This is the opposite of bubbling behavior, where the event | 49 * the target. This is the opposite of bubbling behavior, where the event |
| 50 * is first processed for the event target and then bubbles upward. | 50 * is first processed for the event target and then bubbles upward. |
| 51 * | 51 * |
| 52 * ## Other Resources | 52 * ## Other resources |
| 53 * | 53 * |
| 54 * * [Event Capture] | 54 * * [Event Capture] |
| 55 * (http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture) | 55 * (http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-capture) |
| 56 * from the W3C DOM Events specification. | 56 * from the W3C DOM Events specification. |
| 57 */ | 57 */ |
| 58 StreamSubscription<T> capture(void onData(T event)); | 58 StreamSubscription<T> capture(void onData(T event)); |
| 59 } | 59 } |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * Adapter for exposing DOM Element events as streams, while also allowing | 62 * Adapter for exposing DOM Element events as streams, while also allowing |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 | 421 |
| 422 ElementStream<T> _forElementList(ElementList e, | 422 ElementStream<T> _forElementList(ElementList e, |
| 423 {bool useCapture: false}) { | 423 {bool useCapture: false}) { |
| 424 return new _ElementListEventStreamImpl(e, _eventTypeGetter(e), useCapture); | 424 return new _ElementListEventStreamImpl(e, _eventTypeGetter(e), useCapture); |
| 425 } | 425 } |
| 426 | 426 |
| 427 String getEventType(EventTarget target) { | 427 String getEventType(EventTarget target) { |
| 428 return _eventTypeGetter(target); | 428 return _eventTypeGetter(target); |
| 429 } | 429 } |
| 430 } | 430 } |
| OLD | NEW |