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

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

Issue 11824072: Adding streams to dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback Created 7 years, 11 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
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4047ff8e486f2721ebf7e03c73633f155962b95d..d69974b5579c81a08c459c75cd8799a70fb89032 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -76,6 +76,8 @@ _callPortSync(num id, var message) {
class AbstractWorker extends EventTarget {
AbstractWorker.internal() : super.internal();
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
AbstractWorkerEvents get on =>
new AbstractWorkerEvents(this);
@@ -92,6 +94,8 @@ class AbstractWorker extends EventTarget {
/** @domName AbstractWorker.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "AbstractWorker_removeEventListener_Callback";
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -280,6 +284,22 @@ class AnimationEvent extends Event {
class ApplicationCache extends EventTarget {
ApplicationCache.internal() : super.internal();
+ static const EventStreamProvider<Event> cachedEvent = const EventStreamProvider<Event>('cached');
+
+ static const EventStreamProvider<Event> checkingEvent = const EventStreamProvider<Event>('checking');
+
+ static const EventStreamProvider<Event> downloadingEvent = const EventStreamProvider<Event>('downloading');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> noUpdateEvent = const EventStreamProvider<Event>('noupdate');
+
+ static const EventStreamProvider<Event> obsoleteEvent = const EventStreamProvider<Event>('obsolete');
+
+ static const EventStreamProvider<Event> progressEvent = const EventStreamProvider<Event>('progress');
+
+ static const EventStreamProvider<Event> updateReadyEvent = const EventStreamProvider<Event>('updateready');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
ApplicationCacheEvents get on =>
new ApplicationCacheEvents(this);
@@ -324,6 +344,22 @@ class ApplicationCache extends EventTarget {
/** @domName DOMApplicationCache.update */
void update() native "DOMApplicationCache_update_Callback";
+ Stream<Event> get onCached => cachedEvent.forTarget(this);
+
+ Stream<Event> get onChecking => checkingEvent.forTarget(this);
+
+ Stream<Event> get onDownloading => downloadingEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onNoUpdate => noUpdateEvent.forTarget(this);
+
+ Stream<Event> get onObsolete => obsoleteEvent.forTarget(this);
+
+ Stream<Event> get onProgress => progressEvent.forTarget(this);
+
+ Stream<Event> get onUpdateReady => updateReadyEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -684,6 +720,14 @@ class BaseFontElement extends _Element_Merged {
class BatteryManager extends EventTarget {
BatteryManager.internal() : super.internal();
+ static const EventStreamProvider<Event> chargingChangeEvent = const EventStreamProvider<Event>('chargingchange');
+
+ static const EventStreamProvider<Event> chargingTimeChangeEvent = const EventStreamProvider<Event>('chargingtimechange');
+
+ static const EventStreamProvider<Event> dischargingTimeChangeEvent = const EventStreamProvider<Event>('dischargingtimechange');
+
+ static const EventStreamProvider<Event> levelChangeEvent = const EventStreamProvider<Event>('levelchange');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
BatteryManagerEvents get on =>
new BatteryManagerEvents(this);
@@ -716,6 +760,14 @@ class BatteryManager extends EventTarget {
/** @domName BatteryManager.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "BatteryManager_removeEventListener_Callback";
+ Stream<Event> get onChargingChange => chargingChangeEvent.forTarget(this);
+
+ Stream<Event> get onChargingTimeChange => chargingTimeChangeEvent.forTarget(this);
+
+ Stream<Event> get onDischargingTimeChange => dischargingTimeChangeEvent.forTarget(this);
+
+ Stream<Event> get onLevelChange => levelChangeEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -822,6 +874,32 @@ class Blob extends NativeFieldWrapperClass1 {
class BodyElement extends _Element_Merged {
BodyElement.internal() : super.internal();
+ static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamProvider<Event>('beforeunload');
+
+ static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
+
+ static const EventStreamProvider<HashChangeEvent> hashChangeEvent = const EventStreamProvider<HashChangeEvent>('hashchange');
+
+ static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
+
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
+ static const EventStreamProvider<Event> offlineEvent = const EventStreamProvider<Event>('offline');
+
+ static const EventStreamProvider<Event> onlineEvent = const EventStreamProvider<Event>('online');
+
+ static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStreamProvider<PopStateEvent>('popstate');
+
+ static const EventStreamProvider<Event> resizeEvent = const EventStreamProvider<Event>('resize');
+
+ static const EventStreamProvider<StorageEvent> storageEvent = const EventStreamProvider<StorageEvent>('storage');
+
+ static const EventStreamProvider<Event> unloadEvent = const EventStreamProvider<Event>('unload');
+
///@docsEditable true
factory BodyElement() => document.$dom_createElement("body");
@@ -837,6 +915,32 @@ class BodyElement extends _Element_Merged {
/** @domName HTMLBodyElement.vLink */
void set vLink(String value) native "HTMLBodyElement_vLink_Setter";
+ Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
+
+ Stream<Event> get onBlur => blurEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onFocus => focusEvent.forTarget(this);
+
+ Stream<HashChangeEvent> get onHashChange => hashChangeEvent.forTarget(this);
+
+ Stream<Event> get onLoad => loadEvent.forTarget(this);
+
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
+ Stream<Event> get onOffline => offlineEvent.forTarget(this);
+
+ Stream<Event> get onOnline => onlineEvent.forTarget(this);
+
+ Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
+
+ Stream<Event> get onResize => resizeEvent.forTarget(this);
+
+ Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
+
+ Stream<Event> get onUnload => unloadEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -6463,6 +6567,8 @@ class DatabaseSync extends NativeFieldWrapperClass1 {
class DedicatedWorkerContext extends WorkerContext {
DedicatedWorkerContext.internal() : super.internal();
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
DedicatedWorkerContextEvents get on =>
new DedicatedWorkerContextEvents(this);
@@ -6471,6 +6577,8 @@ class DedicatedWorkerContext extends WorkerContext {
/** @domName DedicatedWorkerContext.postMessage */
void postMessage(Object message, [List messagePorts]) native "DedicatedWorkerContext_postMessage_Callback";
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -6703,6 +6811,104 @@ class Document extends Node
Document.internal() : super.internal();
+ static const EventStreamProvider<Event> abortEvent = const EventStreamProvider<Event>('abort');
+
+ static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamProvider<Event>('beforecopy');
+
+ static const EventStreamProvider<Event> beforeCutEvent = const EventStreamProvider<Event>('beforecut');
+
+ static const EventStreamProvider<Event> beforePasteEvent = const EventStreamProvider<Event>('beforepaste');
+
+ static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
+
+ static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
+
+ static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamProvider<MouseEvent>('click');
+
+ static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStreamProvider<MouseEvent>('contextmenu');
+
+ static const EventStreamProvider<Event> copyEvent = const EventStreamProvider<Event>('copy');
+
+ static const EventStreamProvider<Event> cutEvent = const EventStreamProvider<Event>('cut');
+
+ static const EventStreamProvider<Event> doubleClickEvent = const EventStreamProvider<Event>('dblclick');
+
+ static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProvider<MouseEvent>('drag');
+
+ static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamProvider<MouseEvent>('dragend');
+
+ static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStreamProvider<MouseEvent>('dragenter');
+
+ static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStreamProvider<MouseEvent>('dragleave');
+
+ static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStreamProvider<MouseEvent>('dragover');
+
+ static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStreamProvider<MouseEvent>('dragstart');
+
+ static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProvider<MouseEvent>('drop');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
+
+ static const EventStreamProvider<Event> inputEvent = const EventStreamProvider<Event>('input');
+
+ static const EventStreamProvider<Event> invalidEvent = const EventStreamProvider<Event>('invalid');
+
+ static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStreamProvider<KeyboardEvent>('keydown');
+
+ static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStreamProvider<KeyboardEvent>('keypress');
+
+ static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStreamProvider<KeyboardEvent>('keyup');
+
+ static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
+
+ static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStreamProvider<MouseEvent>('mousedown');
+
+ static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStreamProvider<MouseEvent>('mousemove');
+
+ static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStreamProvider<MouseEvent>('mouseout');
+
+ static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStreamProvider<MouseEvent>('mouseover');
+
+ static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamProvider<MouseEvent>('mouseup');
+
+ static const EventStreamProvider<WheelEvent> mouseWheelEvent = const EventStreamProvider<WheelEvent>('mousewheel');
+
+ static const EventStreamProvider<Event> pasteEvent = const EventStreamProvider<Event>('paste');
+
+ static const EventStreamProvider<Event> readyStateChangeEvent = const EventStreamProvider<Event>('readystatechange');
+
+ static const EventStreamProvider<Event> resetEvent = const EventStreamProvider<Event>('reset');
+
+ static const EventStreamProvider<Event> scrollEvent = const EventStreamProvider<Event>('scroll');
+
+ static const EventStreamProvider<Event> searchEvent = const EventStreamProvider<Event>('search');
+
+ static const EventStreamProvider<Event> selectEvent = const EventStreamProvider<Event>('select');
+
+ static const EventStreamProvider<Event> selectionChangeEvent = const EventStreamProvider<Event>('selectionchange');
+
+ static const EventStreamProvider<Event> selectStartEvent = const EventStreamProvider<Event>('selectstart');
+
+ static const EventStreamProvider<Event> submitEvent = const EventStreamProvider<Event>('submit');
+
+ static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStreamProvider<TouchEvent>('touchcancel');
+
+ static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStreamProvider<TouchEvent>('touchend');
+
+ static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStreamProvider<TouchEvent>('touchmove');
+
+ static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStreamProvider<TouchEvent>('touchstart');
+
+ static const EventStreamProvider<Event> fullscreenChangeEvent = const EventStreamProvider<Event>('webkitfullscreenchange');
+
+ static const EventStreamProvider<Event> fullscreenErrorEvent = const EventStreamProvider<Event>('webkitfullscreenerror');
+
+ static const EventStreamProvider<Event> pointerLockChangeEvent = const EventStreamProvider<Event>('webkitpointerlockchange');
+
+ static const EventStreamProvider<Event> pointerLockErrorEvent = const EventStreamProvider<Event>('webkitpointerlockerror');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
DocumentEvents get on =>
new DocumentEvents(this);
@@ -6919,6 +7125,104 @@ class Document extends Node
/** @domName Document.webkitExitPointerLock */
void $dom_webkitExitPointerLock() native "Document_webkitExitPointerLock_Callback";
+ Stream<Event> get onAbort => abortEvent.forTarget(this);
+
+ Stream<Event> get onBeforeCopy => beforeCopyEvent.forTarget(this);
+
+ Stream<Event> get onBeforeCut => beforeCutEvent.forTarget(this);
+
+ Stream<Event> get onBeforePaste => beforePasteEvent.forTarget(this);
+
+ Stream<Event> get onBlur => blurEvent.forTarget(this);
+
+ Stream<Event> get onChange => changeEvent.forTarget(this);
+
+ Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
+
+ Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
+
+ Stream<Event> get onCopy => copyEvent.forTarget(this);
+
+ Stream<Event> get onCut => cutEvent.forTarget(this);
+
+ Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onFocus => focusEvent.forTarget(this);
+
+ Stream<Event> get onInput => inputEvent.forTarget(this);
+
+ Stream<Event> get onInvalid => invalidEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
+
+ Stream<Event> get onLoad => loadEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
+
+ Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);
+
+ Stream<Event> get onPaste => pasteEvent.forTarget(this);
+
+ Stream<Event> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
+
+ Stream<Event> get onReset => resetEvent.forTarget(this);
+
+ Stream<Event> get onScroll => scrollEvent.forTarget(this);
+
+ Stream<Event> get onSearch => searchEvent.forTarget(this);
+
+ Stream<Event> get onSelect => selectEvent.forTarget(this);
+
+ Stream<Event> get onSelectionChange => selectionChangeEvent.forTarget(this);
+
+ Stream<Event> get onSelectStart => selectStartEvent.forTarget(this);
+
+ Stream<Event> get onSubmit => submitEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
+
+ Stream<Event> get onFullscreenChange => fullscreenChangeEvent.forTarget(this);
+
+ Stream<Event> get onFullscreenError => fullscreenErrorEvent.forTarget(this);
+
+ Stream<Event> get onPointerLockChange => pointerLockChangeEvent.forTarget(this);
+
+ Stream<Event> get onPointerLockError => pointerLockErrorEvent.forTarget(this);
+
/**
* Finds the first descendant element of this document that matches the
@@ -8954,6 +9258,102 @@ abstract class Element extends Node implements ElementTraversal {
Element.internal() : super.internal();
+ static const EventStreamProvider<Event> abortEvent = const EventStreamProvider<Event>('abort');
+
+ static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamProvider<Event>('beforecopy');
+
+ static const EventStreamProvider<Event> beforeCutEvent = const EventStreamProvider<Event>('beforecut');
+
+ static const EventStreamProvider<Event> beforePasteEvent = const EventStreamProvider<Event>('beforepaste');
+
+ static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
+
+ static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
+
+ static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamProvider<MouseEvent>('click');
+
+ static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStreamProvider<MouseEvent>('contextmenu');
+
+ static const EventStreamProvider<Event> copyEvent = const EventStreamProvider<Event>('copy');
+
+ static const EventStreamProvider<Event> cutEvent = const EventStreamProvider<Event>('cut');
+
+ static const EventStreamProvider<Event> doubleClickEvent = const EventStreamProvider<Event>('dblclick');
+
+ static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProvider<MouseEvent>('drag');
+
+ static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamProvider<MouseEvent>('dragend');
+
+ static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStreamProvider<MouseEvent>('dragenter');
+
+ static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStreamProvider<MouseEvent>('dragleave');
+
+ static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStreamProvider<MouseEvent>('dragover');
+
+ static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStreamProvider<MouseEvent>('dragstart');
+
+ static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProvider<MouseEvent>('drop');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
+
+ static const EventStreamProvider<Event> inputEvent = const EventStreamProvider<Event>('input');
+
+ static const EventStreamProvider<Event> invalidEvent = const EventStreamProvider<Event>('invalid');
+
+ static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStreamProvider<KeyboardEvent>('keydown');
+
+ static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStreamProvider<KeyboardEvent>('keypress');
+
+ static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStreamProvider<KeyboardEvent>('keyup');
+
+ static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
+
+ static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStreamProvider<MouseEvent>('mousedown');
+
+ static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStreamProvider<MouseEvent>('mousemove');
+
+ static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStreamProvider<MouseEvent>('mouseout');
+
+ static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStreamProvider<MouseEvent>('mouseover');
+
+ static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamProvider<MouseEvent>('mouseup');
+
+ static const EventStreamProvider<WheelEvent> mouseWheelEvent = const EventStreamProvider<WheelEvent>('mousewheel');
+
+ static const EventStreamProvider<Event> pasteEvent = const EventStreamProvider<Event>('paste');
+
+ static const EventStreamProvider<Event> resetEvent = const EventStreamProvider<Event>('reset');
+
+ static const EventStreamProvider<Event> scrollEvent = const EventStreamProvider<Event>('scroll');
+
+ static const EventStreamProvider<Event> searchEvent = const EventStreamProvider<Event>('search');
+
+ static const EventStreamProvider<Event> selectEvent = const EventStreamProvider<Event>('select');
+
+ static const EventStreamProvider<Event> selectStartEvent = const EventStreamProvider<Event>('selectstart');
+
+ static const EventStreamProvider<Event> submitEvent = const EventStreamProvider<Event>('submit');
+
+ static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStreamProvider<TouchEvent>('touchcancel');
+
+ static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStreamProvider<TouchEvent>('touchend');
+
+ static const EventStreamProvider<TouchEvent> touchEnterEvent = const EventStreamProvider<TouchEvent>('touchenter');
+
+ static const EventStreamProvider<TouchEvent> touchLeaveEvent = const EventStreamProvider<TouchEvent>('touchleave');
+
+ static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStreamProvider<TouchEvent>('touchmove');
+
+ static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStreamProvider<TouchEvent>('touchstart');
+
+ static const EventStreamProvider<TransitionEvent> transitionEndEvent = const EventStreamProvider<TransitionEvent>('webkitTransitionEnd');
+
+ static const EventStreamProvider<Event> fullscreenChangeEvent = const EventStreamProvider<Event>('webkitfullscreenchange');
+
+ static const EventStreamProvider<Event> fullscreenErrorEvent = const EventStreamProvider<Event>('webkitfullscreenerror');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
ElementEvents get on =>
new ElementEvents(this);
@@ -9243,6 +9643,102 @@ abstract class Element extends Node implements ElementTraversal {
/** @domName Element.webkitRequestPointerLock */
void webkitRequestPointerLock() native "Element_webkitRequestPointerLock_Callback";
+ Stream<Event> get onAbort => abortEvent.forTarget(this);
+
+ Stream<Event> get onBeforeCopy => beforeCopyEvent.forTarget(this);
+
+ Stream<Event> get onBeforeCut => beforeCutEvent.forTarget(this);
+
+ Stream<Event> get onBeforePaste => beforePasteEvent.forTarget(this);
+
+ Stream<Event> get onBlur => blurEvent.forTarget(this);
+
+ Stream<Event> get onChange => changeEvent.forTarget(this);
+
+ Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
+
+ Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
+
+ Stream<Event> get onCopy => copyEvent.forTarget(this);
+
+ Stream<Event> get onCut => cutEvent.forTarget(this);
+
+ Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onFocus => focusEvent.forTarget(this);
+
+ Stream<Event> get onInput => inputEvent.forTarget(this);
+
+ Stream<Event> get onInvalid => invalidEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
+
+ Stream<Event> get onLoad => loadEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
+
+ Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);
+
+ Stream<Event> get onPaste => pasteEvent.forTarget(this);
+
+ Stream<Event> get onReset => resetEvent.forTarget(this);
+
+ Stream<Event> get onScroll => scrollEvent.forTarget(this);
+
+ Stream<Event> get onSearch => searchEvent.forTarget(this);
+
+ Stream<Event> get onSelect => selectEvent.forTarget(this);
+
+ Stream<Event> get onSelectStart => selectStartEvent.forTarget(this);
+
+ Stream<Event> get onSubmit => submitEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchEnter => touchEnterEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchLeave => touchLeaveEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
+
+ Stream<TransitionEvent> get onTransitionEnd => transitionEndEvent.forTarget(this);
+
+ Stream<Event> get onFullscreenChange => fullscreenChangeEvent.forTarget(this);
+
+ Stream<Event> get onFullscreenError => fullscreenErrorEvent.forTarget(this);
+
}
final _START_TAG_REGEXP = new RegExp('<(\\w+)');
@@ -9921,6 +10417,12 @@ class EventException extends NativeFieldWrapperClass1 {
class EventSource extends EventTarget {
EventSource.internal() : super.internal();
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
+ static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
+
///@docsEditable true
factory EventSource(String scriptUrl) => EventSource._create(scriptUrl);
static EventSource _create(String scriptUrl) native "EventSource_constructor_Callback";
@@ -9959,6 +10461,12 @@ class EventSource extends EventTarget {
/** @domName EventSource.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "EventSource_removeEventListener_Callback";
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
+ Stream<Event> get onOpen => openEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -10488,8 +10996,20 @@ class FileList extends NativeFieldWrapperClass1 implements List<File> {
class FileReader extends EventTarget {
FileReader.internal() : super.internal();
- ///@docsEditable true
- factory FileReader() => FileReader._create();
+ static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
+
+ static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
+
+ static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
+
+ static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
+
+ ///@docsEditable true
+ factory FileReader() => FileReader._create();
static FileReader _create() native "FileReader_constructor_Callback";
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
@@ -10558,6 +11078,18 @@ class FileReader extends EventTarget {
/** @domName FileReader.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "FileReader_removeEventListener_Callback";
+ Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -10685,6 +11217,18 @@ class FileSystemSync extends NativeFieldWrapperClass1 {
class FileWriter extends EventTarget {
FileWriter.internal() : super.internal();
+ static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
+
+ static const EventStreamProvider<ProgressEvent> writeEvent = const EventStreamProvider<ProgressEvent>('write');
+
+ static const EventStreamProvider<ProgressEvent> writeEndEvent = const EventStreamProvider<ProgressEvent>('writeend');
+
+ static const EventStreamProvider<ProgressEvent> writeStartEvent = const EventStreamProvider<ProgressEvent>('writestart');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
FileWriterEvents get on =>
new FileWriterEvents(this);
@@ -10739,6 +11283,18 @@ class FileWriter extends EventTarget {
/** @domName FileWriter.write */
void write(Blob data) native "FileWriter_write_Callback";
+ Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onWrite => writeEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onWriteEnd => writeEndEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onWriteStart => writeStartEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -11461,6 +12017,32 @@ class FrameElement extends _Element_Merged {
class FrameSetElement extends _Element_Merged {
FrameSetElement.internal() : super.internal();
+ static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamProvider<Event>('beforeunload');
+
+ static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
+
+ static const EventStreamProvider<HashChangeEvent> hashChangeEvent = const EventStreamProvider<HashChangeEvent>('hashchange');
+
+ static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
+
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
+ static const EventStreamProvider<Event> offlineEvent = const EventStreamProvider<Event>('offline');
+
+ static const EventStreamProvider<Event> onlineEvent = const EventStreamProvider<Event>('online');
+
+ static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStreamProvider<PopStateEvent>('popstate');
+
+ static const EventStreamProvider<Event> resizeEvent = const EventStreamProvider<Event>('resize');
+
+ static const EventStreamProvider<StorageEvent> storageEvent = const EventStreamProvider<StorageEvent>('storage');
+
+ static const EventStreamProvider<Event> unloadEvent = const EventStreamProvider<Event>('unload');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
FrameSetElementEvents get on =>
new FrameSetElementEvents(this);
@@ -11481,6 +12063,32 @@ class FrameSetElement extends _Element_Merged {
/** @domName HTMLFrameSetElement.rows */
void set rows(String value) native "HTMLFrameSetElement_rows_Setter";
+ Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
+
+ Stream<Event> get onBlur => blurEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onFocus => focusEvent.forTarget(this);
+
+ Stream<HashChangeEvent> get onHashChange => hashChangeEvent.forTarget(this);
+
+ Stream<Event> get onLoad => loadEvent.forTarget(this);
+
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
+ Stream<Event> get onOffline => offlineEvent.forTarget(this);
+
+ Stream<Event> get onOnline => onlineEvent.forTarget(this);
+
+ Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
+
+ Stream<Event> get onResize => resizeEvent.forTarget(this);
+
+ Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
+
+ Stream<Event> get onUnload => unloadEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -12323,6 +12931,20 @@ class HttpRequest extends EventTarget {
HttpRequest.internal() : super.internal();
+ static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
+
+ static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
+
+ static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
+
+ static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
+
+ static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
+
+ static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
+
+ static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
+
///@docsEditable true
factory HttpRequest() => HttpRequest._create();
static HttpRequest _create() native "XMLHttpRequest_constructor_Callback";
@@ -12425,6 +13047,20 @@ class HttpRequest extends EventTarget {
/** @domName XMLHttpRequest.setRequestHeader */
void setRequestHeader(String header, String value) native "XMLHttpRequest_setRequestHeader_Callback";
+ Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -12516,6 +13152,18 @@ class HttpRequestProgressEvent extends ProgressEvent {
class HttpRequestUpload extends EventTarget {
HttpRequestUpload.internal() : super.internal();
+ static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
+
+ static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
+
+ static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
+
+ static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
+
+ static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
+
+ static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
HttpRequestUploadEvents get on =>
new HttpRequestUploadEvents(this);
@@ -12532,6 +13180,18 @@ class HttpRequestUpload extends EventTarget {
/** @domName XMLHttpRequestUpload.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "XMLHttpRequestUpload_removeEventListener_Callback";
+ Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
+
+ Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -12805,6 +13465,8 @@ class InputElement extends _Element_Merged implements
}
InputElement.internal() : super.internal();
+ static const EventStreamProvider<Event> speechChangeEvent = const EventStreamProvider<Event>('webkitSpeechChange');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
InputElementEvents get on =>
new InputElementEvents(this);
@@ -13241,6 +13903,8 @@ class InputElement extends _Element_Merged implements
/** @domName HTMLInputElement.stepUp_2 */
void _stepUp_2() native "HTMLInputElement_stepUp_2_Callback";
+ Stream<Event> get onSpeechChange => speechChangeEvent.forTarget(this);
+
}
@@ -15167,6 +15831,56 @@ class MediaController extends EventTarget {
class MediaElement extends _Element_Merged {
MediaElement.internal() : super.internal();
+ static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvider<Event>('canplay');
+
+ static const EventStreamProvider<Event> canPlayThroughEvent = const EventStreamProvider<Event>('canplaythrough');
+
+ static const EventStreamProvider<Event> durationChangeEvent = const EventStreamProvider<Event>('durationchange');
+
+ static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvider<Event>('emptied');
+
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+
+ static const EventStreamProvider<Event> loadedDataEvent = const EventStreamProvider<Event>('loadeddata');
+
+ static const EventStreamProvider<Event> loadedMetadataEvent = const EventStreamProvider<Event>('loadedmetadata');
+
+ static const EventStreamProvider<Event> loadStartEvent = const EventStreamProvider<Event>('loadstart');
+
+ static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider<Event>('pause');
+
+ static const EventStreamProvider<Event> playEvent = const EventStreamProvider<Event>('play');
+
+ static const EventStreamProvider<Event> playingEvent = const EventStreamProvider<Event>('playing');
+
+ static const EventStreamProvider<Event> progressEvent = const EventStreamProvider<Event>('progress');
+
+ static const EventStreamProvider<Event> rateChangeEvent = const EventStreamProvider<Event>('ratechange');
+
+ static const EventStreamProvider<Event> seekedEvent = const EventStreamProvider<Event>('seeked');
+
+ static const EventStreamProvider<Event> seekingEvent = const EventStreamProvider<Event>('seeking');
+
+ static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
+
+ static const EventStreamProvider<Event> stalledEvent = const EventStreamProvider<Event>('stalled');
+
+ static const EventStreamProvider<Event> suspendEvent = const EventStreamProvider<Event>('suspend');
+
+ static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamProvider<Event>('timeupdate');
+
+ static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamProvider<Event>('volumechange');
+
+ static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
+
+ static const EventStreamProvider<MediaKeyEvent> keyAddedEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyadded');
+
+ static const EventStreamProvider<MediaKeyEvent> keyErrorEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyerror');
+
+ static const EventStreamProvider<MediaKeyEvent> keyMessageEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeymessage');
+
+ static const EventStreamProvider<MediaKeyEvent> needKeyEvent = const EventStreamProvider<MediaKeyEvent>('webkitneedkey');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
MediaElementEvents get on =>
new MediaElementEvents(this);
@@ -15451,6 +16165,56 @@ class MediaElement extends _Element_Merged {
/** @domName HTMLMediaElement.webkitGenerateKeyRequest_2 */
void _webkitGenerateKeyRequest_2(keySystem) native "HTMLMediaElement_webkitGenerateKeyRequest_2_Callback";
+ Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
+
+ Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
+
+ Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
+
+ Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
+
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
+
+ Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
+
+ Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
+
+ Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
+
+ Stream<Event> get onPause => pauseEvent.forTarget(this);
+
+ Stream<Event> get onPlay => playEvent.forTarget(this);
+
+ Stream<Event> get onPlaying => playingEvent.forTarget(this);
+
+ Stream<Event> get onProgress => progressEvent.forTarget(this);
+
+ Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
+
+ Stream<Event> get onSeeked => seekedEvent.forTarget(this);
+
+ Stream<Event> get onSeeking => seekingEvent.forTarget(this);
+
+ Stream<Event> get onShow => showEvent.forTarget(this);
+
+ Stream<Event> get onStalled => stalledEvent.forTarget(this);
+
+ Stream<Event> get onSuspend => suspendEvent.forTarget(this);
+
+ Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
+
+ Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
+
+ Stream<Event> get onWaiting => waitingEvent.forTarget(this);
+
+ Stream<MediaKeyEvent> get onKeyAdded => keyAddedEvent.forTarget(this);
+
+ Stream<MediaKeyEvent> get onKeyError => keyErrorEvent.forTarget(this);
+
+ Stream<MediaKeyEvent> get onKeyMessage => keyMessageEvent.forTarget(this);
+
+ Stream<MediaKeyEvent> get onNeedKey => needKeyEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -15778,6 +16542,8 @@ class MediaSource extends EventTarget {
class MediaStream extends EventTarget {
MediaStream.internal() : super.internal();
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+
///@docsEditable true
factory MediaStream(MediaStreamTrackList audioTracks, MediaStreamTrackList videoTracks) => MediaStream._create(audioTracks, videoTracks);
static MediaStream _create(MediaStreamTrackList audioTracks, MediaStreamTrackList videoTracks) native "MediaStream_constructor_Callback";
@@ -15818,6 +16584,8 @@ class MediaStream extends EventTarget {
/** @domName MediaStream.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStream_removeEventListener_Callback";
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -15855,6 +16623,12 @@ class MediaStreamEvent extends Event {
class MediaStreamTrack extends EventTarget {
MediaStreamTrack.internal() : super.internal();
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+
+ static const EventStreamProvider<Event> muteEvent = const EventStreamProvider<Event>('mute');
+
+ static const EventStreamProvider<Event> unmuteEvent = const EventStreamProvider<Event>('unmute');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
MediaStreamTrackEvents get on =>
new MediaStreamTrackEvents(this);
@@ -15897,6 +16671,12 @@ class MediaStreamTrack extends EventTarget {
/** @domName MediaStreamTrack.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStreamTrack_removeEventListener_Callback";
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
+
+ Stream<Event> get onMute => muteEvent.forTarget(this);
+
+ Stream<Event> get onUnmute => unmuteEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -15940,6 +16720,10 @@ class MediaStreamTrackEvent extends Event {
class MediaStreamTrackList extends EventTarget {
MediaStreamTrackList.internal() : super.internal();
+ static const EventStreamProvider<MediaStreamTrackEvent> addTrackEvent = const EventStreamProvider<MediaStreamTrackEvent>('addtrack');
+
+ static const EventStreamProvider<MediaStreamTrackEvent> removeTrackEvent = const EventStreamProvider<MediaStreamTrackEvent>('removetrack');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
MediaStreamTrackListEvents get on =>
new MediaStreamTrackListEvents(this);
@@ -15972,6 +16756,10 @@ class MediaStreamTrackList extends EventTarget {
/** @domName MediaStreamTrackList.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "MediaStreamTrackList_removeEventListener_Callback";
+ Stream<MediaStreamTrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
+
+ Stream<MediaStreamTrackEvent> get onRemoveTrack => removeTrackEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -16099,6 +16887,8 @@ class MessageEvent extends Event {
class MessagePort extends EventTarget {
MessagePort.internal() : super.internal();
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
MessagePortEvents get on =>
new MessagePortEvents(this);
@@ -16127,6 +16917,8 @@ class MessagePort extends EventTarget {
/** @domName MessagePort.start */
void start() native "MessagePort_start_Callback";
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -17573,6 +18365,16 @@ class Notation extends Node {
class Notification extends EventTarget {
Notification.internal() : super.internal();
+ static const EventStreamProvider<Event> clickEvent = const EventStreamProvider<Event>('click');
+
+ static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
+
+ static const EventStreamProvider<Event> displayEvent = const EventStreamProvider<Event>('display');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
+
///@docsEditable true
factory Notification(String title, [Map options]) {
if (!?options) {
@@ -17642,6 +18444,16 @@ class Notification extends EventTarget {
/** @domName Notification.show */
void show() native "Notification_show_Callback";
+ Stream<Event> get onClick => clickEvent.forTarget(this);
+
+ Stream<Event> get onClose => closeEvent.forTarget(this);
+
+ Stream<Event> get onDisplay => displayEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onShow => showEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -18912,6 +19724,14 @@ class RgbColor extends NativeFieldWrapperClass1 {
class RtcDataChannel extends EventTarget {
RtcDataChannel.internal() : super.internal();
+ static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
+ static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
RtcDataChannelEvents get on =>
new RtcDataChannelEvents(this);
@@ -18992,6 +19812,14 @@ class RtcDataChannel extends EventTarget {
/** @domName RTCDataChannel.send_4 */
void _send_4(data) native "RTCDataChannel_send_4_Callback";
+ Stream<Event> get onClose => closeEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
+ Stream<Event> get onOpen => openEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -19082,6 +19910,22 @@ class RtcIceCandidateEvent extends Event {
class RtcPeerConnection extends EventTarget {
RtcPeerConnection.internal() : super.internal();
+ static const EventStreamProvider<MediaStreamEvent> addStreamEvent = const EventStreamProvider<MediaStreamEvent>('addstream');
+
+ static const EventStreamProvider<RtcDataChannelEvent> dataChannelEvent = const EventStreamProvider<RtcDataChannelEvent>('datachannel');
+
+ static const EventStreamProvider<RtcIceCandidateEvent> iceCandidateEvent = const EventStreamProvider<RtcIceCandidateEvent>('icecandidate');
+
+ static const EventStreamProvider<Event> iceChangeEvent = const EventStreamProvider<Event>('icechange');
+
+ static const EventStreamProvider<Event> negotiationNeededEvent = const EventStreamProvider<Event>('negotiationneeded');
+
+ static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
+
+ static const EventStreamProvider<MediaStreamEvent> removeStreamEvent = const EventStreamProvider<MediaStreamEvent>('removestream');
+
+ static const EventStreamProvider<Event> stateChangeEvent = const EventStreamProvider<Event>('statechange');
+
///@docsEditable true
factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
if (!?mediaConstraints) {
@@ -19179,6 +20023,22 @@ class RtcPeerConnection extends EventTarget {
/** @domName RTCPeerConnection.updateIce */
void updateIce([Map configuration, Map mediaConstraints]) native "RTCPeerConnection_updateIce_Callback";
+ Stream<MediaStreamEvent> get onAddStream => addStreamEvent.forTarget(this);
+
+ Stream<RtcDataChannelEvent> get onDataChannel => dataChannelEvent.forTarget(this);
+
+ Stream<RtcIceCandidateEvent> get onIceCandidate => iceCandidateEvent.forTarget(this);
+
+ Stream<Event> get onIceChange => iceChangeEvent.forTarget(this);
+
+ Stream<Event> get onNegotiationNeeded => negotiationNeededEvent.forTarget(this);
+
+ Stream<Event> get onOpen => openEvent.forTarget(this);
+
+ Stream<MediaStreamEvent> get onRemoveStream => removeStreamEvent.forTarget(this);
+
+ Stream<Event> get onStateChange => stateChangeEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -19806,6 +20666,8 @@ class SharedWorker extends AbstractWorker {
class SharedWorkerContext extends WorkerContext {
SharedWorkerContext.internal() : super.internal();
+ static const EventStreamProvider<Event> connectEvent = const EventStreamProvider<Event>('connect');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
SharedWorkerContextEvents get on =>
new SharedWorkerContextEvents(this);
@@ -19814,6 +20676,8 @@ class SharedWorkerContext extends WorkerContext {
/** @domName SharedWorkerContext.name */
String get name native "SharedWorkerContext_name_Getter";
+ Stream<Event> get onConnect => connectEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -20367,6 +21231,28 @@ class SpeechInputResult extends NativeFieldWrapperClass1 {
class SpeechRecognition extends EventTarget {
SpeechRecognition.internal() : super.internal();
+ static const EventStreamProvider<Event> audioEndEvent = const EventStreamProvider<Event>('audioend');
+
+ static const EventStreamProvider<Event> audioStartEvent = const EventStreamProvider<Event>('audiostart');
+
+ static const EventStreamProvider<Event> endEvent = const EventStreamProvider<Event>('end');
+
+ static const EventStreamProvider<SpeechRecognitionError> errorEvent = const EventStreamProvider<SpeechRecognitionError>('error');
+
+ static const EventStreamProvider<SpeechRecognitionEvent> noMatchEvent = const EventStreamProvider<SpeechRecognitionEvent>('nomatch');
+
+ static const EventStreamProvider<SpeechRecognitionEvent> resultEvent = const EventStreamProvider<SpeechRecognitionEvent>('result');
+
+ static const EventStreamProvider<Event> soundEndEvent = const EventStreamProvider<Event>('soundend');
+
+ static const EventStreamProvider<Event> soundStartEvent = const EventStreamProvider<Event>('soundstart');
+
+ static const EventStreamProvider<Event> speechEndEvent = const EventStreamProvider<Event>('speechend');
+
+ static const EventStreamProvider<Event> speechStartEvent = const EventStreamProvider<Event>('speechstart');
+
+ static const EventStreamProvider<Event> startEvent = const EventStreamProvider<Event>('start');
+
///@docsEditable true
factory SpeechRecognition() => SpeechRecognition._create();
static SpeechRecognition _create() native "SpeechRecognition_constructor_Callback";
@@ -20439,6 +21325,28 @@ class SpeechRecognition extends EventTarget {
/** @domName SpeechRecognition.stop */
void stop() native "SpeechRecognition_stop_Callback";
+ Stream<Event> get onAudioEnd => audioEndEvent.forTarget(this);
+
+ Stream<Event> get onAudioStart => audioStartEvent.forTarget(this);
+
+ Stream<Event> get onEnd => endEvent.forTarget(this);
+
+ Stream<SpeechRecognitionError> get onError => errorEvent.forTarget(this);
+
+ Stream<SpeechRecognitionEvent> get onNoMatch => noMatchEvent.forTarget(this);
+
+ Stream<SpeechRecognitionEvent> get onResult => resultEvent.forTarget(this);
+
+ Stream<Event> get onSoundEnd => soundEndEvent.forTarget(this);
+
+ Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
+
+ Stream<Event> get onSpeechEnd => speechEndEvent.forTarget(this);
+
+ Stream<Event> get onSpeechStart => speechStartEvent.forTarget(this);
+
+ Stream<Event> get onStart => startEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -21682,6 +22590,8 @@ class TextMetrics extends NativeFieldWrapperClass1 {
class TextTrack extends EventTarget {
TextTrack.internal() : super.internal();
+ static const EventStreamProvider<Event> cueChangeEvent = const EventStreamProvider<Event>('cuechange');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
TextTrackEvents get on =>
new TextTrackEvents(this);
@@ -21734,6 +22644,8 @@ class TextTrack extends EventTarget {
/** @domName TextTrack.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrack_removeEventListener_Callback";
+ Stream<Event> get onCueChange => cueChangeEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -21755,6 +22667,10 @@ class TextTrackEvents extends Events {
class TextTrackCue extends EventTarget {
TextTrackCue.internal() : super.internal();
+ static const EventStreamProvider<Event> enterEvent = const EventStreamProvider<Event>('enter');
+
+ static const EventStreamProvider<Event> exitEvent = const EventStreamProvider<Event>('exit');
+
///@docsEditable true
factory TextTrackCue(num startTime, num endTime, String text) => TextTrackCue._create(startTime, endTime, text);
static TextTrackCue _create(num startTime, num endTime, String text) native "TextTrackCue_constructor_Callback";
@@ -21871,6 +22787,10 @@ class TextTrackCue extends EventTarget {
/** @domName TextTrackCue.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrackCue_removeEventListener_Callback";
+ Stream<Event> get onEnter => enterEvent.forTarget(this);
+
+ Stream<Event> get onExit => exitEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -22064,6 +22984,8 @@ class TextTrackCueList extends NativeFieldWrapperClass1 implements List<TextTrac
class TextTrackList extends EventTarget implements List<TextTrack> {
TextTrackList.internal() : super.internal();
+ static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStreamProvider<TrackEvent>('addtrack');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
TextTrackListEvents get on =>
new TextTrackListEvents(this);
@@ -22233,6 +23155,8 @@ class TextTrackList extends EventTarget implements List<TextTrack> {
/** @domName TextTrackList.removeEventListener */
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native "TextTrackList_removeEventListener_Callback";
+ Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -25339,6 +26263,14 @@ class WebKitNamedFlow extends EventTarget {
class WebSocket extends EventTarget {
WebSocket.internal() : super.internal();
+ static const EventStreamProvider<CloseEvent> closeEvent = const EventStreamProvider<CloseEvent>('close');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
+ static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
+
///@docsEditable true
factory WebSocket(String url) => WebSocket._create(url);
static WebSocket _create(String url) native "WebSocket_constructor_Callback";
@@ -25485,6 +26417,14 @@ class WebSocket extends EventTarget {
/** @domName WebSocket.send_7 */
void _send_7(data) native "WebSocket_send_7_Callback";
+ Stream<CloseEvent> get onClose => closeEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
+ Stream<Event> get onOpen => openEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -25576,6 +26516,154 @@ class Window extends EventTarget implements WindowBase {
Window.internal() : super.internal();
+ static const EventStreamProvider<Event> contentLoadedEvent = const EventStreamProvider<Event>('DOMContentLoaded');
+
+ static const EventStreamProvider<Event> abortEvent = const EventStreamProvider<Event>('abort');
+
+ static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamProvider<Event>('beforeunload');
+
+ static const EventStreamProvider<Event> blurEvent = const EventStreamProvider<Event>('blur');
+
+ static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvider<Event>('canplay');
+
+ static const EventStreamProvider<Event> canPlayThroughEvent = const EventStreamProvider<Event>('canplaythrough');
+
+ static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
+
+ static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamProvider<MouseEvent>('click');
+
+ static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStreamProvider<MouseEvent>('contextmenu');
+
+ static const EventStreamProvider<Event> doubleClickEvent = const EventStreamProvider<Event>('dblclick');
+
+ static const EventStreamProvider<DeviceMotionEvent> deviceMotionEvent = const EventStreamProvider<DeviceMotionEvent>('devicemotion');
+
+ static const EventStreamProvider<DeviceOrientationEvent> deviceOrientationEvent = const EventStreamProvider<DeviceOrientationEvent>('deviceorientation');
+
+ static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProvider<MouseEvent>('drag');
+
+ static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamProvider<MouseEvent>('dragend');
+
+ static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStreamProvider<MouseEvent>('dragenter');
+
+ static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStreamProvider<MouseEvent>('dragleave');
+
+ static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStreamProvider<MouseEvent>('dragover');
+
+ static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStreamProvider<MouseEvent>('dragstart');
+
+ static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProvider<MouseEvent>('drop');
+
+ static const EventStreamProvider<Event> durationChangeEvent = const EventStreamProvider<Event>('durationchange');
+
+ static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvider<Event>('emptied');
+
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
+ static const EventStreamProvider<Event> focusEvent = const EventStreamProvider<Event>('focus');
+
+ static const EventStreamProvider<HashChangeEvent> hashChangeEvent = const EventStreamProvider<HashChangeEvent>('hashchange');
+
+ static const EventStreamProvider<Event> inputEvent = const EventStreamProvider<Event>('input');
+
+ static const EventStreamProvider<Event> invalidEvent = const EventStreamProvider<Event>('invalid');
+
+ static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStreamProvider<KeyboardEvent>('keydown');
+
+ static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStreamProvider<KeyboardEvent>('keypress');
+
+ static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStreamProvider<KeyboardEvent>('keyup');
+
+ static const EventStreamProvider<Event> loadEvent = const EventStreamProvider<Event>('load');
+
+ static const EventStreamProvider<Event> loadedDataEvent = const EventStreamProvider<Event>('loadeddata');
+
+ static const EventStreamProvider<Event> loadedMetadataEvent = const EventStreamProvider<Event>('loadedmetadata');
+
+ static const EventStreamProvider<Event> loadStartEvent = const EventStreamProvider<Event>('loadstart');
+
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
+ static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStreamProvider<MouseEvent>('mousedown');
+
+ static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStreamProvider<MouseEvent>('mousemove');
+
+ static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStreamProvider<MouseEvent>('mouseout');
+
+ static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStreamProvider<MouseEvent>('mouseover');
+
+ static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamProvider<MouseEvent>('mouseup');
+
+ static const EventStreamProvider<WheelEvent> mouseWheelEvent = const EventStreamProvider<WheelEvent>('mousewheel');
+
+ static const EventStreamProvider<Event> offlineEvent = const EventStreamProvider<Event>('offline');
+
+ static const EventStreamProvider<Event> onlineEvent = const EventStreamProvider<Event>('online');
+
+ static const EventStreamProvider<Event> pageHideEvent = const EventStreamProvider<Event>('pagehide');
+
+ static const EventStreamProvider<Event> pageShowEvent = const EventStreamProvider<Event>('pageshow');
+
+ static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider<Event>('pause');
+
+ static const EventStreamProvider<Event> playEvent = const EventStreamProvider<Event>('play');
+
+ static const EventStreamProvider<Event> playingEvent = const EventStreamProvider<Event>('playing');
+
+ static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStreamProvider<PopStateEvent>('popstate');
+
+ static const EventStreamProvider<Event> progressEvent = const EventStreamProvider<Event>('progress');
+
+ static const EventStreamProvider<Event> rateChangeEvent = const EventStreamProvider<Event>('ratechange');
+
+ static const EventStreamProvider<Event> resetEvent = const EventStreamProvider<Event>('reset');
+
+ static const EventStreamProvider<Event> resizeEvent = const EventStreamProvider<Event>('resize');
+
+ static const EventStreamProvider<Event> scrollEvent = const EventStreamProvider<Event>('scroll');
+
+ static const EventStreamProvider<Event> searchEvent = const EventStreamProvider<Event>('search');
+
+ static const EventStreamProvider<Event> seekedEvent = const EventStreamProvider<Event>('seeked');
+
+ static const EventStreamProvider<Event> seekingEvent = const EventStreamProvider<Event>('seeking');
+
+ static const EventStreamProvider<Event> selectEvent = const EventStreamProvider<Event>('select');
+
+ static const EventStreamProvider<Event> stalledEvent = const EventStreamProvider<Event>('stalled');
+
+ static const EventStreamProvider<StorageEvent> storageEvent = const EventStreamProvider<StorageEvent>('storage');
+
+ static const EventStreamProvider<Event> submitEvent = const EventStreamProvider<Event>('submit');
+
+ static const EventStreamProvider<Event> suspendEvent = const EventStreamProvider<Event>('suspend');
+
+ static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamProvider<Event>('timeupdate');
+
+ static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStreamProvider<TouchEvent>('touchcancel');
+
+ static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStreamProvider<TouchEvent>('touchend');
+
+ static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStreamProvider<TouchEvent>('touchmove');
+
+ static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStreamProvider<TouchEvent>('touchstart');
+
+ static const EventStreamProvider<Event> unloadEvent = const EventStreamProvider<Event>('unload');
+
+ static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamProvider<Event>('volumechange');
+
+ static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
+
+ static const EventStreamProvider<AnimationEvent> animationEndEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationEnd');
+
+ static const EventStreamProvider<AnimationEvent> animationIterationEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationIteration');
+
+ static const EventStreamProvider<AnimationEvent> animationStartEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationStart');
+
+ static const EventStreamProvider<TransitionEvent> transitionEndEvent = const EventStreamProvider<TransitionEvent>('webkitTransitionEnd');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
WindowEvents get on =>
new WindowEvents(this);
@@ -25956,6 +27044,154 @@ class Window extends EventTarget implements WindowBase {
/** @domName DOMWindow.webkitResolveLocalFileSystemURL */
void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback, [ErrorCallback errorCallback]) native "DOMWindow_webkitResolveLocalFileSystemURL_Callback";
+ Stream<Event> get onContentLoaded => contentLoadedEvent.forTarget(this);
+
+ Stream<Event> get onAbort => abortEvent.forTarget(this);
+
+ Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
+
+ Stream<Event> get onBlur => blurEvent.forTarget(this);
+
+ Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
+
+ Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
+
+ Stream<Event> get onChange => changeEvent.forTarget(this);
+
+ Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
+
+ Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
+
+ Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
+
+ Stream<DeviceMotionEvent> get onDeviceMotion => deviceMotionEvent.forTarget(this);
+
+ Stream<DeviceOrientationEvent> get onDeviceOrientation => deviceOrientationEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
+
+ Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
+
+ Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
+
+ Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
+
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
+
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ Stream<Event> get onFocus => focusEvent.forTarget(this);
+
+ Stream<HashChangeEvent> get onHashChange => hashChangeEvent.forTarget(this);
+
+ Stream<Event> get onInput => inputEvent.forTarget(this);
+
+ Stream<Event> get onInvalid => invalidEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
+
+ Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
+
+ Stream<Event> get onLoad => loadEvent.forTarget(this);
+
+ Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
+
+ Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
+
+ Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
+
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
+
+ Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
+
+ Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);
+
+ Stream<Event> get onOffline => offlineEvent.forTarget(this);
+
+ Stream<Event> get onOnline => onlineEvent.forTarget(this);
+
+ Stream<Event> get onPageHide => pageHideEvent.forTarget(this);
+
+ Stream<Event> get onPageShow => pageShowEvent.forTarget(this);
+
+ Stream<Event> get onPause => pauseEvent.forTarget(this);
+
+ Stream<Event> get onPlay => playEvent.forTarget(this);
+
+ Stream<Event> get onPlaying => playingEvent.forTarget(this);
+
+ Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
+
+ Stream<Event> get onProgress => progressEvent.forTarget(this);
+
+ Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
+
+ Stream<Event> get onReset => resetEvent.forTarget(this);
+
+ Stream<Event> get onResize => resizeEvent.forTarget(this);
+
+ Stream<Event> get onScroll => scrollEvent.forTarget(this);
+
+ Stream<Event> get onSearch => searchEvent.forTarget(this);
+
+ Stream<Event> get onSeeked => seekedEvent.forTarget(this);
+
+ Stream<Event> get onSeeking => seekingEvent.forTarget(this);
+
+ Stream<Event> get onSelect => selectEvent.forTarget(this);
+
+ Stream<Event> get onStalled => stalledEvent.forTarget(this);
+
+ Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
+
+ Stream<Event> get onSubmit => submitEvent.forTarget(this);
+
+ Stream<Event> get onSuspend => suspendEvent.forTarget(this);
+
+ Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
+
+ Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
+
+ Stream<Event> get onUnload => unloadEvent.forTarget(this);
+
+ Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
+
+ Stream<Event> get onWaiting => waitingEvent.forTarget(this);
+
+ Stream<AnimationEvent> get onAnimationEnd => animationEndEvent.forTarget(this);
+
+ Stream<AnimationEvent> get onAnimationIteration => animationIterationEvent.forTarget(this);
+
+ Stream<AnimationEvent> get onAnimationStart => animationStartEvent.forTarget(this);
+
+ Stream<TransitionEvent> get onTransitionEnd => transitionEndEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -26196,6 +27432,8 @@ class WindowEvents extends Events {
class Worker extends AbstractWorker {
Worker.internal() : super.internal();
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+
///@docsEditable true
factory Worker(String scriptUrl) => Worker._create(scriptUrl);
static Worker _create(String scriptUrl) native "Worker_constructor_Callback";
@@ -26212,6 +27450,8 @@ class Worker extends AbstractWorker {
/** @domName Worker.terminate */
void terminate() native "Worker_terminate_Callback";
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -26233,6 +27473,8 @@ class WorkerEvents extends AbstractWorkerEvents {
class WorkerContext extends EventTarget {
WorkerContext.internal() : super.internal();
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+
/// @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent; @docsEditable true
WorkerContextEvents get on =>
new WorkerContextEvents(this);
@@ -26325,6 +27567,8 @@ class WorkerContext extends EventTarget {
/** @domName WorkerContext.webkitResolveLocalFileSystemURL */
void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback, [ErrorCallback errorCallback]) native "WorkerContext_webkitResolveLocalFileSystemURL_Callback";
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
}
/// @docsEditable true
@@ -28916,6 +30160,142 @@ abstract class CssClassSet implements Set<String> {
typedef void EventListener(Event event);
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+/**
+ * Adapter for exposing DOM events as Dart streams.
+ */
+class _EventStream<T extends Event> extends Stream<T> {
+ final EventTarget _target;
+ final String _eventType;
+ final bool _useCapture;
+
+ _EventStream(this._target, this._eventType, this._useCapture);
+
+ // DOM events are inherently multi-subscribers.
+ Stream<T> asMultiSubscriberStream() => this;
+
+ StreamSubscription<T> listen(void onData(T event),
+ { void onError(AsyncError error),
+ void onDone(),
+ bool unsubscribeOnError}) {
+
+ return new _EventStreamSubscription<T>(
+ this._target, this._eventType, onData, this._useCapture);
+ }
+}
+
+class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
+ int _pauseCount = 0;
+ EventTarget _target;
+ final String _eventType;
+ var _onData;
+ final bool _useCapture;
+
+ _EventStreamSubscription(this._target, this._eventType, this._onData,
+ this._useCapture) {
+ _tryResume();
+ }
+
+ void cancel() {
+ if (_canceled) {
+ throw new StateError("Subscription has been canceled.");
+ }
+
+ _unlisten();
+ // Clear out the target to indicate this is complete.
+ _target = null;
+ _onData = null;
+ }
+
+ bool get _canceled => _target == null;
+
+ void onData(void handleData(T event)) {
+ if (_canceled) {
+ throw new StateError("Subscription has been canceled.");
+ }
+ // Remove current event listener.
+ _unlisten();
+
+ _onData = handleData;
+ _tryResume();
+ }
+
+ /// Has no effect.
+ void onError(void handleError(AsyncError error)) {}
+
+ /// Has no effect.
+ void onDone(void handleDone()) {}
+
+ void pause([Future resumeSignal]) {
+ if (_canceled) {
+ throw new StateError("Subscription has been canceled.");
+ }
+ ++_pauseCount;
+ _unlisten();
+
+ if (resumeSignal != null) {
+ resumeSignal.whenComplete(resume);
+ }
+ }
+
+ bool get _paused => _pauseCount > 0;
+
+ void resume() {
+ if (_canceled) {
+ throw new StateError("Subscription has been canceled.");
+ }
+ if (!_paused) {
+ throw new StateError("Subscription is not paused.");
+ }
+ --_pauseCount;
+ _tryResume();
+ }
+
+ void _tryResume() {
+ if (_onData != null && !_paused) {
+ _target.$dom_addEventListener(_eventType, _onData, _useCapture);
+ }
+ }
+
+ void _unlisten() {
+ if (_onData != null) {
+ _target.$dom_removeEventListener(_eventType, _onData, _useCapture);
+ }
+ }
+}
+
+
+/**
+ * A factory to expose DOM events as Streams.
+ */
+class EventStreamProvider<T extends Event> {
+ final String _eventType;
+
+ const EventStreamProvider(this._eventType);
+
+ /**
+ * Gets a [Stream] for this event type, on the specified target.
+ *
+ * This may be used to capture DOM events:
+ *
+ * Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
+ *
+ * Or for listening to an event which will bubble through the DOM tree:
+ *
+ * MediaElement.pauseEvent.forTarget(document.body).listen(...);
+ *
+ * See also:
+ *
+ * [addEventListener](http://docs.webplatform.org/wiki/dom/methods/addEventListener)
+ */
+ Stream<T> forTarget(EventTarget e, {bool useCapture: false}) {
+ return new _EventStream(e, _eventType, useCapture);
+ }
+}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698