OLD | NEW |
1 /// The Dart HTML library. | 1 /// The Dart HTML library. |
2 library dart.dom.html; | 2 library dart.dom.html; |
3 | 3 |
4 import 'dart:async'; | 4 import 'dart:async'; |
5 import 'dart:collection'; | 5 import 'dart:collection'; |
6 import 'dart:_collection-dev' hide Symbol; | 6 import 'dart:_collection-dev' hide Symbol; |
7 import 'dart:html_common'; | 7 import 'dart:html_common'; |
8 import 'dart:indexed_db'; | 8 import 'dart:indexed_db'; |
9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
10 import 'dart:json' as json; | 10 import 'dart:json' as json; |
(...skipping 26048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
26059 * Adapter for exposing DOM events as Dart streams. | 26059 * Adapter for exposing DOM events as Dart streams. |
26060 */ | 26060 */ |
26061 class _EventStream<T extends Event> extends Stream<T> { | 26061 class _EventStream<T extends Event> extends Stream<T> { |
26062 final EventTarget _target; | 26062 final EventTarget _target; |
26063 final String _eventType; | 26063 final String _eventType; |
26064 final bool _useCapture; | 26064 final bool _useCapture; |
26065 | 26065 |
26066 _EventStream(this._target, this._eventType, this._useCapture); | 26066 _EventStream(this._target, this._eventType, this._useCapture); |
26067 | 26067 |
26068 // DOM events are inherently multi-subscribers. | 26068 // DOM events are inherently multi-subscribers. |
26069 Stream<T> asBroadcastStream() => this; | 26069 Stream<T> asBroadcastStream({void onListen(StreamSubscription subscription), |
| 26070 void onCancel(StreamSubscription subscription)}) |
| 26071 => this; |
26070 bool get isBroadcast => true; | 26072 bool get isBroadcast => true; |
26071 | 26073 |
26072 StreamSubscription<T> listen(void onData(T event), | 26074 StreamSubscription<T> listen(void onData(T event), |
26073 { void onError(error), | 26075 { void onError(error), |
26074 void onDone(), | 26076 void onDone(), |
26075 bool cancelOnError}) { | 26077 bool cancelOnError}) { |
26076 | 26078 |
26077 return new _EventStreamSubscription<T>( | 26079 return new _EventStreamSubscription<T>( |
26078 this._target, this._eventType, onData, this._useCapture); | 26080 this._target, this._eventType, onData, this._useCapture); |
26079 } | 26081 } |
(...skipping 3517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
29597 _position = nextPosition; | 29599 _position = nextPosition; |
29598 return true; | 29600 return true; |
29599 } | 29601 } |
29600 _current = null; | 29602 _current = null; |
29601 _position = _array.length; | 29603 _position = _array.length; |
29602 return false; | 29604 return false; |
29603 } | 29605 } |
29604 | 29606 |
29605 T get current => _current; | 29607 T get current => _current; |
29606 } | 29608 } |
OLD | NEW |