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

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.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:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'dart:html_common'; 5 import 'dart:html_common';
6 import 'dart:indexed_db'; 6 import 'dart:indexed_db';
7 import 'dart:isolate'; 7 import 'dart:isolate';
8 import 'dart:json' as json; 8 import 'dart:json' as json;
9 import 'dart:math'; 9 import 'dart:math';
10 import 'dart:svg' as svg; 10 import 'dart:svg' as svg;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 spawnDomFunction(f) => IsolateNatives.spawnDomFunction(f); 51 spawnDomFunction(f) => IsolateNatives.spawnDomFunction(f);
52 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 52 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
53 // for details. All rights reserved. Use of this source code is governed by a 53 // for details. All rights reserved. Use of this source code is governed by a
54 // BSD-style license that can be found in the LICENSE file. 54 // BSD-style license that can be found in the LICENSE file.
55 55
56 56
57 /// @domName AbstractWorker; @docsEditable true 57 /// @domName AbstractWorker; @docsEditable true
58 class AbstractWorker extends EventTarget native "*AbstractWorker" { 58 class AbstractWorker extends EventTarget native "*AbstractWorker" {
59 59
60 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
61
60 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 62 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
61 AbstractWorkerEvents get on => 63 AbstractWorkerEvents get on =>
62 new AbstractWorkerEvents(this); 64 new AbstractWorkerEvents(this);
63 65
64 /// @domName AbstractWorker.addEventListener; @docsEditable true 66 /// @domName AbstractWorker.addEventListener; @docsEditable true
65 @JSName('addEventListener') 67 @JSName('addEventListener')
66 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 68 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
67 69
68 /// @domName AbstractWorker.dispatchEvent; @docsEditable true 70 /// @domName AbstractWorker.dispatchEvent; @docsEditable true
69 @JSName('dispatchEvent') 71 @JSName('dispatchEvent')
70 bool $dom_dispatchEvent(Event evt) native; 72 bool $dom_dispatchEvent(Event evt) native;
71 73
72 /// @domName AbstractWorker.removeEventListener; @docsEditable true 74 /// @domName AbstractWorker.removeEventListener; @docsEditable true
73 @JSName('removeEventListener') 75 @JSName('removeEventListener')
74 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 76 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
77
78 Stream<Event> get onError => errorEvent.forTarget(this);
75 } 79 }
76 80
77 /// @docsEditable true 81 /// @docsEditable true
78 class AbstractWorkerEvents extends Events { 82 class AbstractWorkerEvents extends Events {
79 /// @docsEditable true 83 /// @docsEditable true
80 AbstractWorkerEvents(EventTarget _ptr) : super(_ptr); 84 AbstractWorkerEvents(EventTarget _ptr) : super(_ptr);
81 85
82 /// @docsEditable true 86 /// @docsEditable true
83 EventListenerList get error => this['error']; 87 EventListenerList get error => this['error'];
84 } 88 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 final num elapsedTime; 167 final num elapsedTime;
164 } 168 }
165 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 169 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
166 // for details. All rights reserved. Use of this source code is governed by a 170 // for details. All rights reserved. Use of this source code is governed by a
167 // BSD-style license that can be found in the LICENSE file. 171 // BSD-style license that can be found in the LICENSE file.
168 172
169 173
170 /// @domName DOMApplicationCache; @docsEditable true 174 /// @domName DOMApplicationCache; @docsEditable true
171 class ApplicationCache extends EventTarget native "*DOMApplicationCache" { 175 class ApplicationCache extends EventTarget native "*DOMApplicationCache" {
172 176
177 static const EventStreamProvider<Event> cachedEvent = const EventStreamProvide r<Event>('cached');
178
179 static const EventStreamProvider<Event> checkingEvent = const EventStreamProvi der<Event>('checking');
180
181 static const EventStreamProvider<Event> downloadingEvent = const EventStreamPr ovider<Event>('downloading');
182
183 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
184
185 static const EventStreamProvider<Event> noUpdateEvent = const EventStreamProvi der<Event>('noupdate');
186
187 static const EventStreamProvider<Event> obsoleteEvent = const EventStreamProvi der<Event>('obsolete');
188
189 static const EventStreamProvider<Event> progressEvent = const EventStreamProvi der<Event>('progress');
190
191 static const EventStreamProvider<Event> updateReadyEvent = const EventStreamPr ovider<Event>('updateready');
192
173 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 193 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
174 ApplicationCacheEvents get on => 194 ApplicationCacheEvents get on =>
175 new ApplicationCacheEvents(this); 195 new ApplicationCacheEvents(this);
176 196
177 static const int CHECKING = 2; 197 static const int CHECKING = 2;
178 198
179 static const int DOWNLOADING = 3; 199 static const int DOWNLOADING = 3;
180 200
181 static const int IDLE = 1; 201 static const int IDLE = 1;
182 202
(...skipping 19 matching lines...) Expand all
202 222
203 /// @domName DOMApplicationCache.removeEventListener; @docsEditable true 223 /// @domName DOMApplicationCache.removeEventListener; @docsEditable true
204 @JSName('removeEventListener') 224 @JSName('removeEventListener')
205 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 225 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
206 226
207 /// @domName DOMApplicationCache.swapCache; @docsEditable true 227 /// @domName DOMApplicationCache.swapCache; @docsEditable true
208 void swapCache() native; 228 void swapCache() native;
209 229
210 /// @domName DOMApplicationCache.update; @docsEditable true 230 /// @domName DOMApplicationCache.update; @docsEditable true
211 void update() native; 231 void update() native;
232
233 Stream<Event> get onCached => cachedEvent.forTarget(this);
234
235 Stream<Event> get onChecking => checkingEvent.forTarget(this);
236
237 Stream<Event> get onDownloading => downloadingEvent.forTarget(this);
238
239 Stream<Event> get onError => errorEvent.forTarget(this);
240
241 Stream<Event> get onNoUpdate => noUpdateEvent.forTarget(this);
242
243 Stream<Event> get onObsolete => obsoleteEvent.forTarget(this);
244
245 Stream<Event> get onProgress => progressEvent.forTarget(this);
246
247 Stream<Event> get onUpdateReady => updateReadyEvent.forTarget(this);
212 } 248 }
213 249
214 /// @docsEditable true 250 /// @docsEditable true
215 class ApplicationCacheEvents extends Events { 251 class ApplicationCacheEvents extends Events {
216 /// @docsEditable true 252 /// @docsEditable true
217 ApplicationCacheEvents(EventTarget _ptr) : super(_ptr); 253 ApplicationCacheEvents(EventTarget _ptr) : super(_ptr);
218 254
219 /// @docsEditable true 255 /// @docsEditable true
220 EventListenerList get cached => this['cached']; 256 EventListenerList get cached => this['cached'];
221 257
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 int size; 502 int size;
467 } 503 }
468 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 504 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
469 // for details. All rights reserved. Use of this source code is governed by a 505 // for details. All rights reserved. Use of this source code is governed by a
470 // BSD-style license that can be found in the LICENSE file. 506 // BSD-style license that can be found in the LICENSE file.
471 507
472 508
473 /// @domName BatteryManager; @docsEditable true 509 /// @domName BatteryManager; @docsEditable true
474 class BatteryManager extends EventTarget native "*BatteryManager" { 510 class BatteryManager extends EventTarget native "*BatteryManager" {
475 511
512 static const EventStreamProvider<Event> chargingChangeEvent = const EventStrea mProvider<Event>('chargingchange');
513
514 static const EventStreamProvider<Event> chargingTimeChangeEvent = const EventS treamProvider<Event>('chargingtimechange');
515
516 static const EventStreamProvider<Event> dischargingTimeChangeEvent = const Eve ntStreamProvider<Event>('dischargingtimechange');
517
518 static const EventStreamProvider<Event> levelChangeEvent = const EventStreamPr ovider<Event>('levelchange');
519
476 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 520 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
477 BatteryManagerEvents get on => 521 BatteryManagerEvents get on =>
478 new BatteryManagerEvents(this); 522 new BatteryManagerEvents(this);
479 523
480 /// @domName BatteryManager.charging; @docsEditable true 524 /// @domName BatteryManager.charging; @docsEditable true
481 final bool charging; 525 final bool charging;
482 526
483 /// @domName BatteryManager.chargingTime; @docsEditable true 527 /// @domName BatteryManager.chargingTime; @docsEditable true
484 final num chargingTime; 528 final num chargingTime;
485 529
486 /// @domName BatteryManager.dischargingTime; @docsEditable true 530 /// @domName BatteryManager.dischargingTime; @docsEditable true
487 final num dischargingTime; 531 final num dischargingTime;
488 532
489 /// @domName BatteryManager.level; @docsEditable true 533 /// @domName BatteryManager.level; @docsEditable true
490 final num level; 534 final num level;
491 535
492 /// @domName BatteryManager.addEventListener; @docsEditable true 536 /// @domName BatteryManager.addEventListener; @docsEditable true
493 @JSName('addEventListener') 537 @JSName('addEventListener')
494 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 538 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
495 539
496 /// @domName BatteryManager.dispatchEvent; @docsEditable true 540 /// @domName BatteryManager.dispatchEvent; @docsEditable true
497 @JSName('dispatchEvent') 541 @JSName('dispatchEvent')
498 bool $dom_dispatchEvent(Event event) native; 542 bool $dom_dispatchEvent(Event event) native;
499 543
500 /// @domName BatteryManager.removeEventListener; @docsEditable true 544 /// @domName BatteryManager.removeEventListener; @docsEditable true
501 @JSName('removeEventListener') 545 @JSName('removeEventListener')
502 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 546 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
547
548 Stream<Event> get onChargingChange => chargingChangeEvent.forTarget(this);
549
550 Stream<Event> get onChargingTimeChange => chargingTimeChangeEvent.forTarget(th is);
551
552 Stream<Event> get onDischargingTimeChange => dischargingTimeChangeEvent.forTar get(this);
553
554 Stream<Event> get onLevelChange => levelChangeEvent.forTarget(this);
503 } 555 }
504 556
505 /// @docsEditable true 557 /// @docsEditable true
506 class BatteryManagerEvents extends Events { 558 class BatteryManagerEvents extends Events {
507 /// @docsEditable true 559 /// @docsEditable true
508 BatteryManagerEvents(EventTarget _ptr) : super(_ptr); 560 BatteryManagerEvents(EventTarget _ptr) : super(_ptr);
509 561
510 /// @docsEditable true 562 /// @docsEditable true
511 EventListenerList get chargingChange => this['chargingchange']; 563 EventListenerList get chargingChange => this['chargingchange'];
512 564
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 631 }
580 632
581 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 633 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
582 // for details. All rights reserved. Use of this source code is governed by a 634 // for details. All rights reserved. Use of this source code is governed by a
583 // BSD-style license that can be found in the LICENSE file. 635 // BSD-style license that can be found in the LICENSE file.
584 636
585 637
586 /// @domName HTMLBodyElement; @docsEditable true 638 /// @domName HTMLBodyElement; @docsEditable true
587 class BodyElement extends Element native "*HTMLBodyElement" { 639 class BodyElement extends Element native "*HTMLBodyElement" {
588 640
641 static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamP rovider<Event>('beforeunload');
642
643 static const EventStreamProvider<Event> blurEvent = const EventStreamProvider< Event>('blur');
644
645 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
646
647 static const EventStreamProvider<Event> focusEvent = const EventStreamProvider <Event>('focus');
648
649 static const EventStreamProvider<HashChangeEvent> hashChangeEvent = const Even tStreamProvider<HashChangeEvent>('hashchange');
650
651 static const EventStreamProvider<Event> loadEvent = const EventStreamProvider< Event>('load');
652
653 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
654
655 static const EventStreamProvider<Event> offlineEvent = const EventStreamProvid er<Event>('offline');
656
657 static const EventStreamProvider<Event> onlineEvent = const EventStreamProvide r<Event>('online');
658
659 static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStr eamProvider<PopStateEvent>('popstate');
660
661 static const EventStreamProvider<Event> resizeEvent = const EventStreamProvide r<Event>('resize');
662
663 static const EventStreamProvider<StorageEvent> storageEvent = const EventStrea mProvider<StorageEvent>('storage');
664
665 static const EventStreamProvider<Event> unloadEvent = const EventStreamProvide r<Event>('unload');
666
589 ///@docsEditable true 667 ///@docsEditable true
590 factory BodyElement() => document.$dom_createElement("body"); 668 factory BodyElement() => document.$dom_createElement("body");
591 669
592 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 670 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
593 BodyElementEvents get on => 671 BodyElementEvents get on =>
594 new BodyElementEvents(this); 672 new BodyElementEvents(this);
595 673
596 /// @domName HTMLBodyElement.vLink; @docsEditable true 674 /// @domName HTMLBodyElement.vLink; @docsEditable true
597 String vLink; 675 String vLink;
676
677 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
678
679 Stream<Event> get onBlur => blurEvent.forTarget(this);
680
681 Stream<Event> get onError => errorEvent.forTarget(this);
682
683 Stream<Event> get onFocus => focusEvent.forTarget(this);
684
685 Stream<HashChangeEvent> get onHashChange => hashChangeEvent.forTarget(this);
686
687 Stream<Event> get onLoad => loadEvent.forTarget(this);
688
689 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
690
691 Stream<Event> get onOffline => offlineEvent.forTarget(this);
692
693 Stream<Event> get onOnline => onlineEvent.forTarget(this);
694
695 Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
696
697 Stream<Event> get onResize => resizeEvent.forTarget(this);
698
699 Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
700
701 Stream<Event> get onUnload => unloadEvent.forTarget(this);
598 } 702 }
599 703
600 /// @docsEditable true 704 /// @docsEditable true
601 class BodyElementEvents extends ElementEvents { 705 class BodyElementEvents extends ElementEvents {
602 /// @docsEditable true 706 /// @docsEditable true
603 BodyElementEvents(EventTarget _ptr) : super(_ptr); 707 BodyElementEvents(EventTarget _ptr) : super(_ptr);
604 708
605 /// @docsEditable true 709 /// @docsEditable true
606 EventListenerList get beforeUnload => this['beforeunload']; 710 EventListenerList get beforeUnload => this['beforeunload'];
607 711
(...skipping 4813 matching lines...) Expand 10 before | Expand all | Expand 10 after
5421 void transaction(SqlTransactionSyncCallback callback) native; 5525 void transaction(SqlTransactionSyncCallback callback) native;
5422 } 5526 }
5423 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 5527 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
5424 // for details. All rights reserved. Use of this source code is governed by a 5528 // for details. All rights reserved. Use of this source code is governed by a
5425 // BSD-style license that can be found in the LICENSE file. 5529 // BSD-style license that can be found in the LICENSE file.
5426 5530
5427 5531
5428 /// @domName DedicatedWorkerContext; @docsEditable true 5532 /// @domName DedicatedWorkerContext; @docsEditable true
5429 class DedicatedWorkerContext extends WorkerContext native "*DedicatedWorkerConte xt" { 5533 class DedicatedWorkerContext extends WorkerContext native "*DedicatedWorkerConte xt" {
5430 5534
5535 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
5536
5431 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 5537 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
5432 DedicatedWorkerContextEvents get on => 5538 DedicatedWorkerContextEvents get on =>
5433 new DedicatedWorkerContextEvents(this); 5539 new DedicatedWorkerContextEvents(this);
5434 5540
5435 /// @domName DedicatedWorkerContext.postMessage; @docsEditable true 5541 /// @domName DedicatedWorkerContext.postMessage; @docsEditable true
5436 void postMessage(/*any*/ message, [List messagePorts]) { 5542 void postMessage(/*any*/ message, [List messagePorts]) {
5437 if (?messagePorts) { 5543 if (?messagePorts) {
5438 var message_1 = convertDartToNative_SerializedScriptValue(message); 5544 var message_1 = convertDartToNative_SerializedScriptValue(message);
5439 _postMessage_1(message_1, messagePorts); 5545 _postMessage_1(message_1, messagePorts);
5440 return; 5546 return;
5441 } 5547 }
5442 var message_2 = convertDartToNative_SerializedScriptValue(message); 5548 var message_2 = convertDartToNative_SerializedScriptValue(message);
5443 _postMessage_2(message_2); 5549 _postMessage_2(message_2);
5444 return; 5550 return;
5445 } 5551 }
5446 @JSName('postMessage') 5552 @JSName('postMessage')
5447 void _postMessage_1(message, List messagePorts) native; 5553 void _postMessage_1(message, List messagePorts) native;
5448 @JSName('postMessage') 5554 @JSName('postMessage')
5449 void _postMessage_2(message) native; 5555 void _postMessage_2(message) native;
5556
5557 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
5450 } 5558 }
5451 5559
5452 /// @docsEditable true 5560 /// @docsEditable true
5453 class DedicatedWorkerContextEvents extends WorkerContextEvents { 5561 class DedicatedWorkerContextEvents extends WorkerContextEvents {
5454 /// @docsEditable true 5562 /// @docsEditable true
5455 DedicatedWorkerContextEvents(EventTarget _ptr) : super(_ptr); 5563 DedicatedWorkerContextEvents(EventTarget _ptr) : super(_ptr);
5456 5564
5457 /// @docsEditable true 5565 /// @docsEditable true
5458 EventListenerList get message => this['message']; 5566 EventListenerList get message => this['message'];
5459 } 5567 }
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
5693 * Each web page loaded in the browser has its own [Document] object, which is 5801 * Each web page loaded in the browser has its own [Document] object, which is
5694 * typically an [HtmlDocument]. 5802 * typically an [HtmlDocument].
5695 * 5803 *
5696 * If you aren't comfortable with DOM concepts, see the Dart tutorial 5804 * If you aren't comfortable with DOM concepts, see the Dart tutorial
5697 * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connec t-dart-html/). 5805 * [Target 2: Connect Dart & HTML](http://www.dartlang.org/docs/tutorials/connec t-dart-html/).
5698 */ 5806 */
5699 class Document extends Node native "*Document" 5807 class Document extends Node native "*Document"
5700 { 5808 {
5701 5809
5702 5810
5811 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
5812
5813 static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamPro vider<Event>('beforecopy');
5814
5815 static const EventStreamProvider<Event> beforeCutEvent = const EventStreamProv ider<Event>('beforecut');
5816
5817 static const EventStreamProvider<Event> beforePasteEvent = const EventStreamPr ovider<Event>('beforepaste');
5818
5819 static const EventStreamProvider<Event> blurEvent = const EventStreamProvider< Event>('blur');
5820
5821 static const EventStreamProvider<Event> changeEvent = const EventStreamProvide r<Event>('change');
5822
5823 static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamPro vider<MouseEvent>('click');
5824
5825 static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStr eamProvider<MouseEvent>('contextmenu');
5826
5827 static const EventStreamProvider<Event> copyEvent = const EventStreamProvider< Event>('copy');
5828
5829 static const EventStreamProvider<Event> cutEvent = const EventStreamProvider<E vent>('cut');
5830
5831 static const EventStreamProvider<Event> doubleClickEvent = const EventStreamPr ovider<Event>('dblclick');
5832
5833 static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProv ider<MouseEvent>('drag');
5834
5835 static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamP rovider<MouseEvent>('dragend');
5836
5837 static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStrea mProvider<MouseEvent>('dragenter');
5838
5839 static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStrea mProvider<MouseEvent>('dragleave');
5840
5841 static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStream Provider<MouseEvent>('dragover');
5842
5843 static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStrea mProvider<MouseEvent>('dragstart');
5844
5845 static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProv ider<MouseEvent>('drop');
5846
5847 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
5848
5849 static const EventStreamProvider<Event> focusEvent = const EventStreamProvider <Event>('focus');
5850
5851 static const EventStreamProvider<Event> inputEvent = const EventStreamProvider <Event>('input');
5852
5853 static const EventStreamProvider<Event> invalidEvent = const EventStreamProvid er<Event>('invalid');
5854
5855 static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStre amProvider<KeyboardEvent>('keydown');
5856
5857 static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStr eamProvider<KeyboardEvent>('keypress');
5858
5859 static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStream Provider<KeyboardEvent>('keyup');
5860
5861 static const EventStreamProvider<Event> loadEvent = const EventStreamProvider< Event>('load');
5862
5863 static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStrea mProvider<MouseEvent>('mousedown');
5864
5865 static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStrea mProvider<MouseEvent>('mousemove');
5866
5867 static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStream Provider<MouseEvent>('mouseout');
5868
5869 static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStrea mProvider<MouseEvent>('mouseover');
5870
5871 static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamP rovider<MouseEvent>('mouseup');
5872
5873 static const EventStreamProvider<WheelEvent> mouseWheelEvent = const EventStre amProvider<WheelEvent>('mousewheel');
5874
5875 static const EventStreamProvider<Event> pasteEvent = const EventStreamProvider <Event>('paste');
5876
5877 static const EventStreamProvider<Event> readyStateChangeEvent = const EventStr eamProvider<Event>('readystatechange');
5878
5879 static const EventStreamProvider<Event> resetEvent = const EventStreamProvider <Event>('reset');
5880
5881 static const EventStreamProvider<Event> scrollEvent = const EventStreamProvide r<Event>('scroll');
5882
5883 static const EventStreamProvider<Event> searchEvent = const EventStreamProvide r<Event>('search');
5884
5885 static const EventStreamProvider<Event> selectEvent = const EventStreamProvide r<Event>('select');
5886
5887 static const EventStreamProvider<Event> selectionChangeEvent = const EventStre amProvider<Event>('selectionchange');
5888
5889 static const EventStreamProvider<Event> selectStartEvent = const EventStreamPr ovider<Event>('selectstart');
5890
5891 static const EventStreamProvider<Event> submitEvent = const EventStreamProvide r<Event>('submit');
5892
5893 static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStr eamProvider<TouchEvent>('touchcancel');
5894
5895 static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStream Provider<TouchEvent>('touchend');
5896
5897 static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStrea mProvider<TouchEvent>('touchmove');
5898
5899 static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStre amProvider<TouchEvent>('touchstart');
5900
5901 static const EventStreamProvider<Event> fullscreenChangeEvent = const EventStr eamProvider<Event>('webkitfullscreenchange');
5902
5903 static const EventStreamProvider<Event> fullscreenErrorEvent = const EventStre amProvider<Event>('webkitfullscreenerror');
5904
5905 static const EventStreamProvider<Event> pointerLockChangeEvent = const EventSt reamProvider<Event>('webkitpointerlockchange');
5906
5907 static const EventStreamProvider<Event> pointerLockErrorEvent = const EventStr eamProvider<Event>('webkitpointerlockerror');
5908
5703 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 5909 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
5704 DocumentEvents get on => 5910 DocumentEvents get on =>
5705 new DocumentEvents(this); 5911 new DocumentEvents(this);
5706 5912
5707 /// Moved to [HtmlDocument]. 5913 /// Moved to [HtmlDocument].
5708 /// @domName Document.body; @docsEditable true 5914 /// @domName Document.body; @docsEditable true
5709 @JSName('body') 5915 @JSName('body')
5710 Element $dom_body; 5916 Element $dom_body;
5711 5917
5712 /// @domName Document.charset; @docsEditable true 5918 /// @domName Document.charset; @docsEditable true
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
5909 /// Moved to [HtmlDocument]. 6115 /// Moved to [HtmlDocument].
5910 /// @domName Document.webkitExitFullscreen; @docsEditable true 6116 /// @domName Document.webkitExitFullscreen; @docsEditable true
5911 @JSName('webkitExitFullscreen') 6117 @JSName('webkitExitFullscreen')
5912 void $dom_webkitExitFullscreen() native; 6118 void $dom_webkitExitFullscreen() native;
5913 6119
5914 /// Moved to [HtmlDocument]. 6120 /// Moved to [HtmlDocument].
5915 /// @domName Document.webkitExitPointerLock; @docsEditable true 6121 /// @domName Document.webkitExitPointerLock; @docsEditable true
5916 @JSName('webkitExitPointerLock') 6122 @JSName('webkitExitPointerLock')
5917 void $dom_webkitExitPointerLock() native; 6123 void $dom_webkitExitPointerLock() native;
5918 6124
6125 Stream<Event> get onAbort => abortEvent.forTarget(this);
6126
6127 Stream<Event> get onBeforeCopy => beforeCopyEvent.forTarget(this);
6128
6129 Stream<Event> get onBeforeCut => beforeCutEvent.forTarget(this);
6130
6131 Stream<Event> get onBeforePaste => beforePasteEvent.forTarget(this);
6132
6133 Stream<Event> get onBlur => blurEvent.forTarget(this);
6134
6135 Stream<Event> get onChange => changeEvent.forTarget(this);
6136
6137 Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
6138
6139 Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
6140
6141 Stream<Event> get onCopy => copyEvent.forTarget(this);
6142
6143 Stream<Event> get onCut => cutEvent.forTarget(this);
6144
6145 Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
6146
6147 Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
6148
6149 Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
6150
6151 Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
6152
6153 Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
6154
6155 Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
6156
6157 Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
6158
6159 Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
6160
6161 Stream<Event> get onError => errorEvent.forTarget(this);
6162
6163 Stream<Event> get onFocus => focusEvent.forTarget(this);
6164
6165 Stream<Event> get onInput => inputEvent.forTarget(this);
6166
6167 Stream<Event> get onInvalid => invalidEvent.forTarget(this);
6168
6169 Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
6170
6171 Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
6172
6173 Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
6174
6175 Stream<Event> get onLoad => loadEvent.forTarget(this);
6176
6177 Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
6178
6179 Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
6180
6181 Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
6182
6183 Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
6184
6185 Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
6186
6187 Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);
6188
6189 Stream<Event> get onPaste => pasteEvent.forTarget(this);
6190
6191 Stream<Event> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
6192
6193 Stream<Event> get onReset => resetEvent.forTarget(this);
6194
6195 Stream<Event> get onScroll => scrollEvent.forTarget(this);
6196
6197 Stream<Event> get onSearch => searchEvent.forTarget(this);
6198
6199 Stream<Event> get onSelect => selectEvent.forTarget(this);
6200
6201 Stream<Event> get onSelectionChange => selectionChangeEvent.forTarget(this);
6202
6203 Stream<Event> get onSelectStart => selectStartEvent.forTarget(this);
6204
6205 Stream<Event> get onSubmit => submitEvent.forTarget(this);
6206
6207 Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
6208
6209 Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
6210
6211 Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
6212
6213 Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
6214
6215 Stream<Event> get onFullscreenChange => fullscreenChangeEvent.forTarget(this);
6216
6217 Stream<Event> get onFullscreenError => fullscreenErrorEvent.forTarget(this);
6218
6219 Stream<Event> get onPointerLockChange => pointerLockChangeEvent.forTarget(this );
6220
6221 Stream<Event> get onPointerLockError => pointerLockErrorEvent.forTarget(this);
6222
5919 6223
5920 /** 6224 /**
5921 * Finds the first descendant element of this document that matches the 6225 * Finds the first descendant element of this document that matches the
5922 * specified group of selectors. 6226 * specified group of selectors.
5923 * 6227 *
5924 * Unless your webpage contains multiple documents, the top-level query 6228 * Unless your webpage contains multiple documents, the top-level query
5925 * method behaves the same as this method, so you should use it instead to 6229 * method behaves the same as this method, so you should use it instead to
5926 * save typing a few characters. 6230 * save typing a few characters.
5927 * 6231 *
5928 * [selectors] should be a string using CSS selector syntax. 6232 * [selectors] should be a string using CSS selector syntax.
(...skipping 1990 matching lines...) Expand 10 before | Expand all | Expand 10 after
7919 } else if (JS('bool', '!!#.webkitMatchesSelector', this)) { 8223 } else if (JS('bool', '!!#.webkitMatchesSelector', this)) {
7920 return JS('bool', '#.webkitMatchesSelector(#)', this, selectors); 8224 return JS('bool', '#.webkitMatchesSelector(#)', this, selectors);
7921 } else if (JS('bool', '!!#.mozMatchesSelector', this)) { 8225 } else if (JS('bool', '!!#.mozMatchesSelector', this)) {
7922 return JS('bool', '#.mozMatchesSelector(#)', this, selectors); 8226 return JS('bool', '#.mozMatchesSelector(#)', this, selectors);
7923 } else if (JS('bool', '!!#.msMatchesSelector', this)) { 8227 } else if (JS('bool', '!!#.msMatchesSelector', this)) {
7924 return JS('bool', '#.msMatchesSelector(#)', this, selectors); 8228 return JS('bool', '#.msMatchesSelector(#)', this, selectors);
7925 } 8229 }
7926 } 8230 }
7927 8231
7928 8232
8233 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
8234
8235 static const EventStreamProvider<Event> beforeCopyEvent = const EventStreamPro vider<Event>('beforecopy');
8236
8237 static const EventStreamProvider<Event> beforeCutEvent = const EventStreamProv ider<Event>('beforecut');
8238
8239 static const EventStreamProvider<Event> beforePasteEvent = const EventStreamPr ovider<Event>('beforepaste');
8240
8241 static const EventStreamProvider<Event> blurEvent = const EventStreamProvider< Event>('blur');
8242
8243 static const EventStreamProvider<Event> changeEvent = const EventStreamProvide r<Event>('change');
8244
8245 static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamPro vider<MouseEvent>('click');
8246
8247 static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStr eamProvider<MouseEvent>('contextmenu');
8248
8249 static const EventStreamProvider<Event> copyEvent = const EventStreamProvider< Event>('copy');
8250
8251 static const EventStreamProvider<Event> cutEvent = const EventStreamProvider<E vent>('cut');
8252
8253 static const EventStreamProvider<Event> doubleClickEvent = const EventStreamPr ovider<Event>('dblclick');
8254
8255 static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProv ider<MouseEvent>('drag');
8256
8257 static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamP rovider<MouseEvent>('dragend');
8258
8259 static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStrea mProvider<MouseEvent>('dragenter');
8260
8261 static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStrea mProvider<MouseEvent>('dragleave');
8262
8263 static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStream Provider<MouseEvent>('dragover');
8264
8265 static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStrea mProvider<MouseEvent>('dragstart');
8266
8267 static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProv ider<MouseEvent>('drop');
8268
8269 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
8270
8271 static const EventStreamProvider<Event> focusEvent = const EventStreamProvider <Event>('focus');
8272
8273 static const EventStreamProvider<Event> inputEvent = const EventStreamProvider <Event>('input');
8274
8275 static const EventStreamProvider<Event> invalidEvent = const EventStreamProvid er<Event>('invalid');
8276
8277 static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStre amProvider<KeyboardEvent>('keydown');
8278
8279 static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStr eamProvider<KeyboardEvent>('keypress');
8280
8281 static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStream Provider<KeyboardEvent>('keyup');
8282
8283 static const EventStreamProvider<Event> loadEvent = const EventStreamProvider< Event>('load');
8284
8285 static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStrea mProvider<MouseEvent>('mousedown');
8286
8287 static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStrea mProvider<MouseEvent>('mousemove');
8288
8289 static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStream Provider<MouseEvent>('mouseout');
8290
8291 static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStrea mProvider<MouseEvent>('mouseover');
8292
8293 static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamP rovider<MouseEvent>('mouseup');
8294
8295 static const EventStreamProvider<Event> pasteEvent = const EventStreamProvider <Event>('paste');
8296
8297 static const EventStreamProvider<Event> resetEvent = const EventStreamProvider <Event>('reset');
8298
8299 static const EventStreamProvider<Event> scrollEvent = const EventStreamProvide r<Event>('scroll');
8300
8301 static const EventStreamProvider<Event> searchEvent = const EventStreamProvide r<Event>('search');
8302
8303 static const EventStreamProvider<Event> selectEvent = const EventStreamProvide r<Event>('select');
8304
8305 static const EventStreamProvider<Event> selectStartEvent = const EventStreamPr ovider<Event>('selectstart');
8306
8307 static const EventStreamProvider<Event> submitEvent = const EventStreamProvide r<Event>('submit');
8308
8309 static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStr eamProvider<TouchEvent>('touchcancel');
8310
8311 static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStream Provider<TouchEvent>('touchend');
8312
8313 static const EventStreamProvider<TouchEvent> touchEnterEvent = const EventStre amProvider<TouchEvent>('touchenter');
8314
8315 static const EventStreamProvider<TouchEvent> touchLeaveEvent = const EventStre amProvider<TouchEvent>('touchleave');
8316
8317 static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStrea mProvider<TouchEvent>('touchmove');
8318
8319 static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStre amProvider<TouchEvent>('touchstart');
8320
8321 static const EventStreamProvider<TransitionEvent> transitionEndEvent = const E ventStreamProvider<TransitionEvent>('webkitTransitionEnd');
8322
8323 static const EventStreamProvider<Event> fullscreenChangeEvent = const EventStr eamProvider<Event>('webkitfullscreenchange');
8324
8325 static const EventStreamProvider<Event> fullscreenErrorEvent = const EventStre amProvider<Event>('webkitfullscreenerror');
8326
7929 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 8327 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
7930 ElementEvents get on => 8328 ElementEvents get on =>
7931 new ElementEvents(this); 8329 new ElementEvents(this);
7932 8330
7933 /// @domName HTMLElement.children; @docsEditable true 8331 /// @domName HTMLElement.children; @docsEditable true
7934 @JSName('children') 8332 @JSName('children')
7935 final HtmlCollection $dom_children; 8333 final HtmlCollection $dom_children;
7936 8334
7937 /// @domName HTMLElement.contentEditable; @docsEditable true 8335 /// @domName HTMLElement.contentEditable; @docsEditable true
7938 String contentEditable; 8336 String contentEditable;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
8140 8538
8141 /// @domName Element.webkitRequestFullScreen; @docsEditable true 8539 /// @domName Element.webkitRequestFullScreen; @docsEditable true
8142 void webkitRequestFullScreen(int flags) native; 8540 void webkitRequestFullScreen(int flags) native;
8143 8541
8144 /// @domName Element.webkitRequestFullscreen; @docsEditable true 8542 /// @domName Element.webkitRequestFullscreen; @docsEditable true
8145 void webkitRequestFullscreen() native; 8543 void webkitRequestFullscreen() native;
8146 8544
8147 /// @domName Element.webkitRequestPointerLock; @docsEditable true 8545 /// @domName Element.webkitRequestPointerLock; @docsEditable true
8148 void webkitRequestPointerLock() native; 8546 void webkitRequestPointerLock() native;
8149 8547
8548 Stream<Event> get onAbort => abortEvent.forTarget(this);
8549
8550 Stream<Event> get onBeforeCopy => beforeCopyEvent.forTarget(this);
8551
8552 Stream<Event> get onBeforeCut => beforeCutEvent.forTarget(this);
8553
8554 Stream<Event> get onBeforePaste => beforePasteEvent.forTarget(this);
8555
8556 Stream<Event> get onBlur => blurEvent.forTarget(this);
8557
8558 Stream<Event> get onChange => changeEvent.forTarget(this);
8559
8560 Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
8561
8562 Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
8563
8564 Stream<Event> get onCopy => copyEvent.forTarget(this);
8565
8566 Stream<Event> get onCut => cutEvent.forTarget(this);
8567
8568 Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
8569
8570 Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
8571
8572 Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
8573
8574 Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
8575
8576 Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
8577
8578 Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
8579
8580 Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
8581
8582 Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
8583
8584 Stream<Event> get onError => errorEvent.forTarget(this);
8585
8586 Stream<Event> get onFocus => focusEvent.forTarget(this);
8587
8588 Stream<Event> get onInput => inputEvent.forTarget(this);
8589
8590 Stream<Event> get onInvalid => invalidEvent.forTarget(this);
8591
8592 Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
8593
8594 Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
8595
8596 Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
8597
8598 Stream<Event> get onLoad => loadEvent.forTarget(this);
8599
8600 Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
8601
8602 Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
8603
8604 Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
8605
8606 Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
8607
8608 Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
8609
8610 Stream<Event> get onPaste => pasteEvent.forTarget(this);
8611
8612 Stream<Event> get onReset => resetEvent.forTarget(this);
8613
8614 Stream<Event> get onScroll => scrollEvent.forTarget(this);
8615
8616 Stream<Event> get onSearch => searchEvent.forTarget(this);
8617
8618 Stream<Event> get onSelect => selectEvent.forTarget(this);
8619
8620 Stream<Event> get onSelectStart => selectStartEvent.forTarget(this);
8621
8622 Stream<Event> get onSubmit => submitEvent.forTarget(this);
8623
8624 Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
8625
8626 Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
8627
8628 Stream<TouchEvent> get onTouchEnter => touchEnterEvent.forTarget(this);
8629
8630 Stream<TouchEvent> get onTouchLeave => touchLeaveEvent.forTarget(this);
8631
8632 Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
8633
8634 Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
8635
8636 Stream<TransitionEvent> get onTransitionEnd => transitionEndEvent.forTarget(th is);
8637
8638 Stream<Event> get onFullscreenChange => fullscreenChangeEvent.forTarget(this);
8639
8640 Stream<Event> get onFullscreenError => fullscreenErrorEvent.forTarget(this);
8641
8150 } 8642 }
8151 8643
8152 final _START_TAG_REGEXP = new RegExp('<(\\w+)'); 8644 final _START_TAG_REGEXP = new RegExp('<(\\w+)');
8153 class _ElementFactoryProvider { 8645 class _ElementFactoryProvider {
8154 static final _CUSTOM_PARENT_TAG_MAP = const { 8646 static final _CUSTOM_PARENT_TAG_MAP = const {
8155 'body' : 'html', 8647 'body' : 'html',
8156 'head' : 'html', 8648 'head' : 'html',
8157 'caption' : 'table', 8649 'caption' : 'table',
8158 'td': 'tr', 8650 'td': 'tr',
8159 'colgroup': 'table', 8651 'colgroup': 'table',
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
8693 String toString() native; 9185 String toString() native;
8694 } 9186 }
8695 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9187 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
8696 // for details. All rights reserved. Use of this source code is governed by a 9188 // for details. All rights reserved. Use of this source code is governed by a
8697 // BSD-style license that can be found in the LICENSE file. 9189 // BSD-style license that can be found in the LICENSE file.
8698 9190
8699 9191
8700 /// @domName EventSource; @docsEditable true 9192 /// @domName EventSource; @docsEditable true
8701 class EventSource extends EventTarget native "*EventSource" { 9193 class EventSource extends EventTarget native "*EventSource" {
8702 9194
9195 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
9196
9197 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
9198
9199 static const EventStreamProvider<Event> openEvent = const EventStreamProvider< Event>('open');
9200
8703 ///@docsEditable true 9201 ///@docsEditable true
8704 factory EventSource(String scriptUrl) => EventSource._create(scriptUrl); 9202 factory EventSource(String scriptUrl) => EventSource._create(scriptUrl);
8705 static EventSource _create(String scriptUrl) => JS('EventSource', 'new EventSo urce(#)', scriptUrl); 9203 static EventSource _create(String scriptUrl) => JS('EventSource', 'new EventSo urce(#)', scriptUrl);
8706 9204
8707 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 9205 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
8708 EventSourceEvents get on => 9206 EventSourceEvents get on =>
8709 new EventSourceEvents(this); 9207 new EventSourceEvents(this);
8710 9208
8711 static const int CLOSED = 2; 9209 static const int CLOSED = 2;
8712 9210
(...skipping 14 matching lines...) Expand all
8727 /// @domName EventSource.close; @docsEditable true 9225 /// @domName EventSource.close; @docsEditable true
8728 void close() native; 9226 void close() native;
8729 9227
8730 /// @domName EventSource.dispatchEvent; @docsEditable true 9228 /// @domName EventSource.dispatchEvent; @docsEditable true
8731 @JSName('dispatchEvent') 9229 @JSName('dispatchEvent')
8732 bool $dom_dispatchEvent(Event evt) native; 9230 bool $dom_dispatchEvent(Event evt) native;
8733 9231
8734 /// @domName EventSource.removeEventListener; @docsEditable true 9232 /// @domName EventSource.removeEventListener; @docsEditable true
8735 @JSName('removeEventListener') 9233 @JSName('removeEventListener')
8736 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 9234 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
9235
9236 Stream<Event> get onError => errorEvent.forTarget(this);
9237
9238 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
9239
9240 Stream<Event> get onOpen => openEvent.forTarget(this);
8737 } 9241 }
8738 9242
8739 /// @docsEditable true 9243 /// @docsEditable true
8740 class EventSourceEvents extends Events { 9244 class EventSourceEvents extends Events {
8741 /// @docsEditable true 9245 /// @docsEditable true
8742 EventSourceEvents(EventTarget _ptr) : super(_ptr); 9246 EventSourceEvents(EventTarget _ptr) : super(_ptr);
8743 9247
8744 /// @docsEditable true 9248 /// @docsEditable true
8745 EventListenerList get error => this['error']; 9249 EventListenerList get error => this['error'];
8746 9250
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
9188 File item(int index) native; 9692 File item(int index) native;
9189 } 9693 }
9190 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9694 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9191 // for details. All rights reserved. Use of this source code is governed by a 9695 // for details. All rights reserved. Use of this source code is governed by a
9192 // BSD-style license that can be found in the LICENSE file. 9696 // BSD-style license that can be found in the LICENSE file.
9193 9697
9194 9698
9195 /// @domName FileReader; @docsEditable true 9699 /// @domName FileReader; @docsEditable true
9196 class FileReader extends EventTarget native "*FileReader" { 9700 class FileReader extends EventTarget native "*FileReader" {
9197 9701
9702 static const EventStreamProvider<ProgressEvent> abortEvent = const EventStream Provider<ProgressEvent>('abort');
9703
9704 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
9705
9706 static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamP rovider<ProgressEvent>('load');
9707
9708 static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStre amProvider<ProgressEvent>('loadend');
9709
9710 static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventSt reamProvider<ProgressEvent>('loadstart');
9711
9712 static const EventStreamProvider<ProgressEvent> progressEvent = const EventStr eamProvider<ProgressEvent>('progress');
9713
9198 ///@docsEditable true 9714 ///@docsEditable true
9199 factory FileReader() => FileReader._create(); 9715 factory FileReader() => FileReader._create();
9200 static FileReader _create() => JS('FileReader', 'new FileReader()'); 9716 static FileReader _create() => JS('FileReader', 'new FileReader()');
9201 9717
9202 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 9718 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
9203 FileReaderEvents get on => 9719 FileReaderEvents get on =>
9204 new FileReaderEvents(this); 9720 new FileReaderEvents(this);
9205 9721
9206 static const int DONE = 2; 9722 static const int DONE = 2;
9207 9723
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
9239 /// @domName FileReader.readAsDataURL; @docsEditable true 9755 /// @domName FileReader.readAsDataURL; @docsEditable true
9240 @JSName('readAsDataURL') 9756 @JSName('readAsDataURL')
9241 void readAsDataUrl(Blob blob) native; 9757 void readAsDataUrl(Blob blob) native;
9242 9758
9243 /// @domName FileReader.readAsText; @docsEditable true 9759 /// @domName FileReader.readAsText; @docsEditable true
9244 void readAsText(Blob blob, [String encoding]) native; 9760 void readAsText(Blob blob, [String encoding]) native;
9245 9761
9246 /// @domName FileReader.removeEventListener; @docsEditable true 9762 /// @domName FileReader.removeEventListener; @docsEditable true
9247 @JSName('removeEventListener') 9763 @JSName('removeEventListener')
9248 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 9764 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
9765
9766 Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
9767
9768 Stream<Event> get onError => errorEvent.forTarget(this);
9769
9770 Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
9771
9772 Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
9773
9774 Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
9775
9776 Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
9249 } 9777 }
9250 9778
9251 /// @docsEditable true 9779 /// @docsEditable true
9252 class FileReaderEvents extends Events { 9780 class FileReaderEvents extends Events {
9253 /// @docsEditable true 9781 /// @docsEditable true
9254 FileReaderEvents(EventTarget _ptr) : super(_ptr); 9782 FileReaderEvents(EventTarget _ptr) : super(_ptr);
9255 9783
9256 /// @docsEditable true 9784 /// @docsEditable true
9257 EventListenerList get abort => this['abort']; 9785 EventListenerList get abort => this['abort'];
9258 9786
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
9333 final DirectoryEntrySync root; 9861 final DirectoryEntrySync root;
9334 } 9862 }
9335 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9863 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9336 // for details. All rights reserved. Use of this source code is governed by a 9864 // for details. All rights reserved. Use of this source code is governed by a
9337 // BSD-style license that can be found in the LICENSE file. 9865 // BSD-style license that can be found in the LICENSE file.
9338 9866
9339 9867
9340 /// @domName FileWriter; @docsEditable true 9868 /// @domName FileWriter; @docsEditable true
9341 class FileWriter extends EventTarget native "*FileWriter" { 9869 class FileWriter extends EventTarget native "*FileWriter" {
9342 9870
9871 static const EventStreamProvider<ProgressEvent> abortEvent = const EventStream Provider<ProgressEvent>('abort');
9872
9873 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
9874
9875 static const EventStreamProvider<ProgressEvent> progressEvent = const EventStr eamProvider<ProgressEvent>('progress');
9876
9877 static const EventStreamProvider<ProgressEvent> writeEvent = const EventStream Provider<ProgressEvent>('write');
9878
9879 static const EventStreamProvider<ProgressEvent> writeEndEvent = const EventStr eamProvider<ProgressEvent>('writeend');
9880
9881 static const EventStreamProvider<ProgressEvent> writeStartEvent = const EventS treamProvider<ProgressEvent>('writestart');
9882
9343 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 9883 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
9344 FileWriterEvents get on => 9884 FileWriterEvents get on =>
9345 new FileWriterEvents(this); 9885 new FileWriterEvents(this);
9346 9886
9347 static const int DONE = 2; 9887 static const int DONE = 2;
9348 9888
9349 static const int INIT = 0; 9889 static const int INIT = 0;
9350 9890
9351 static const int WRITING = 1; 9891 static const int WRITING = 1;
9352 9892
(...skipping 25 matching lines...) Expand all
9378 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 9918 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
9379 9919
9380 /// @domName FileWriter.seek; @docsEditable true 9920 /// @domName FileWriter.seek; @docsEditable true
9381 void seek(int position) native; 9921 void seek(int position) native;
9382 9922
9383 /// @domName FileWriter.truncate; @docsEditable true 9923 /// @domName FileWriter.truncate; @docsEditable true
9384 void truncate(int size) native; 9924 void truncate(int size) native;
9385 9925
9386 /// @domName FileWriter.write; @docsEditable true 9926 /// @domName FileWriter.write; @docsEditable true
9387 void write(Blob data) native; 9927 void write(Blob data) native;
9928
9929 Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
9930
9931 Stream<Event> get onError => errorEvent.forTarget(this);
9932
9933 Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
9934
9935 Stream<ProgressEvent> get onWrite => writeEvent.forTarget(this);
9936
9937 Stream<ProgressEvent> get onWriteEnd => writeEndEvent.forTarget(this);
9938
9939 Stream<ProgressEvent> get onWriteStart => writeStartEvent.forTarget(this);
9388 } 9940 }
9389 9941
9390 /// @docsEditable true 9942 /// @docsEditable true
9391 class FileWriterEvents extends Events { 9943 class FileWriterEvents extends Events {
9392 /// @docsEditable true 9944 /// @docsEditable true
9393 FileWriterEvents(EventTarget _ptr) : super(_ptr); 9945 FileWriterEvents(EventTarget _ptr) : super(_ptr);
9394 9946
9395 /// @docsEditable true 9947 /// @docsEditable true
9396 EventListenerList get abort => this['abort']; 9948 EventListenerList get abort => this['abort'];
9397 9949
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
9923 final int width; 10475 final int width;
9924 } 10476 }
9925 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10477 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9926 // for details. All rights reserved. Use of this source code is governed by a 10478 // for details. All rights reserved. Use of this source code is governed by a
9927 // BSD-style license that can be found in the LICENSE file. 10479 // BSD-style license that can be found in the LICENSE file.
9928 10480
9929 10481
9930 /// @domName HTMLFrameSetElement; @docsEditable true 10482 /// @domName HTMLFrameSetElement; @docsEditable true
9931 class FrameSetElement extends Element native "*HTMLFrameSetElement" { 10483 class FrameSetElement extends Element native "*HTMLFrameSetElement" {
9932 10484
10485 static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamP rovider<Event>('beforeunload');
10486
10487 static const EventStreamProvider<Event> blurEvent = const EventStreamProvider< Event>('blur');
10488
10489 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
10490
10491 static const EventStreamProvider<Event> focusEvent = const EventStreamProvider <Event>('focus');
10492
10493 static const EventStreamProvider<HashChangeEvent> hashChangeEvent = const Even tStreamProvider<HashChangeEvent>('hashchange');
10494
10495 static const EventStreamProvider<Event> loadEvent = const EventStreamProvider< Event>('load');
10496
10497 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
10498
10499 static const EventStreamProvider<Event> offlineEvent = const EventStreamProvid er<Event>('offline');
10500
10501 static const EventStreamProvider<Event> onlineEvent = const EventStreamProvide r<Event>('online');
10502
10503 static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStr eamProvider<PopStateEvent>('popstate');
10504
10505 static const EventStreamProvider<Event> resizeEvent = const EventStreamProvide r<Event>('resize');
10506
10507 static const EventStreamProvider<StorageEvent> storageEvent = const EventStrea mProvider<StorageEvent>('storage');
10508
10509 static const EventStreamProvider<Event> unloadEvent = const EventStreamProvide r<Event>('unload');
10510
9933 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 10511 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
9934 FrameSetElementEvents get on => 10512 FrameSetElementEvents get on =>
9935 new FrameSetElementEvents(this); 10513 new FrameSetElementEvents(this);
9936 10514
9937 /// @domName HTMLFrameSetElement.cols; @docsEditable true 10515 /// @domName HTMLFrameSetElement.cols; @docsEditable true
9938 String cols; 10516 String cols;
9939 10517
9940 /// @domName HTMLFrameSetElement.rows; @docsEditable true 10518 /// @domName HTMLFrameSetElement.rows; @docsEditable true
9941 String rows; 10519 String rows;
10520
10521 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
10522
10523 Stream<Event> get onBlur => blurEvent.forTarget(this);
10524
10525 Stream<Event> get onError => errorEvent.forTarget(this);
10526
10527 Stream<Event> get onFocus => focusEvent.forTarget(this);
10528
10529 Stream<HashChangeEvent> get onHashChange => hashChangeEvent.forTarget(this);
10530
10531 Stream<Event> get onLoad => loadEvent.forTarget(this);
10532
10533 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
10534
10535 Stream<Event> get onOffline => offlineEvent.forTarget(this);
10536
10537 Stream<Event> get onOnline => onlineEvent.forTarget(this);
10538
10539 Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
10540
10541 Stream<Event> get onResize => resizeEvent.forTarget(this);
10542
10543 Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
10544
10545 Stream<Event> get onUnload => unloadEvent.forTarget(this);
9942 } 10546 }
9943 10547
9944 /// @docsEditable true 10548 /// @docsEditable true
9945 class FrameSetElementEvents extends ElementEvents { 10549 class FrameSetElementEvents extends ElementEvents {
9946 /// @docsEditable true 10550 /// @docsEditable true
9947 FrameSetElementEvents(EventTarget _ptr) : super(_ptr); 10551 FrameSetElementEvents(EventTarget _ptr) : super(_ptr);
9948 10552
9949 /// @docsEditable true 10553 /// @docsEditable true
9950 EventListenerList get beforeUnload => this['beforeunload']; 10554 EventListenerList get beforeUnload => this['beforeunload'];
9951 10555
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after
10684 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru e. 11288 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru e.
10685 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse t of all the response headers will be returned when calling [getAllRequestHeader s]. 11289 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse t of all the response headers will be returned when calling [getAllRequestHeader s].
10686 * 11290 *
10687 * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access _authentication). 11291 * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access _authentication).
10688 */ 11292 */
10689 factory HttpRequest.getWithCredentials(String url, 11293 factory HttpRequest.getWithCredentials(String url,
10690 onComplete(HttpRequest request)) => 11294 onComplete(HttpRequest request)) =>
10691 _HttpRequestUtils.get(url, onComplete, true); 11295 _HttpRequestUtils.get(url, onComplete, true);
10692 11296
10693 11297
11298 static const EventStreamProvider<ProgressEvent> abortEvent = const EventStream Provider<ProgressEvent>('abort');
11299
11300 static const EventStreamProvider<ProgressEvent> errorEvent = const EventStream Provider<ProgressEvent>('error');
11301
11302 static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamP rovider<ProgressEvent>('load');
11303
11304 static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStre amProvider<ProgressEvent>('loadend');
11305
11306 static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventSt reamProvider<ProgressEvent>('loadstart');
11307
11308 static const EventStreamProvider<ProgressEvent> progressEvent = const EventStr eamProvider<ProgressEvent>('progress');
11309
11310 static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
11311
10694 ///@docsEditable true 11312 ///@docsEditable true
10695 factory HttpRequest() => HttpRequest._create(); 11313 factory HttpRequest() => HttpRequest._create();
10696 static HttpRequest _create() => JS('HttpRequest', 'new XMLHttpRequest()'); 11314 static HttpRequest _create() => JS('HttpRequest', 'new XMLHttpRequest()');
10697 11315
10698 /** 11316 /**
10699 * Get the set of [HttpRequestEvents] that this request can respond to. 11317 * Get the set of [HttpRequestEvents] that this request can respond to.
10700 * Usually used when adding an EventListener, such as in 11318 * Usually used when adding an EventListener, such as in
10701 * `document.window.on.keyDown.add((e) => print('keydown happened'))`. 11319 * `document.window.on.keyDown.add((e) => print('keydown happened'))`.
10702 */ 11320 */
10703 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 11321 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
10894 * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#s end()) 11512 * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#s end())
10895 * from MDN. 11513 * from MDN.
10896 */ 11514 */
10897 /// @domName XMLHttpRequest.send; @docsEditable true 11515 /// @domName XMLHttpRequest.send; @docsEditable true
10898 void send([data]) native; 11516 void send([data]) native;
10899 11517
10900 /** Sets HTTP `header` to `value`. */ 11518 /** Sets HTTP `header` to `value`. */
10901 /// @domName XMLHttpRequest.setRequestHeader; @docsEditable true 11519 /// @domName XMLHttpRequest.setRequestHeader; @docsEditable true
10902 void setRequestHeader(String header, String value) native; 11520 void setRequestHeader(String header, String value) native;
10903 11521
11522 Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
11523
11524 Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
11525
11526 Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
11527
11528 Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
11529
11530 Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
11531
11532 Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
11533
11534 Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarge t(this);
11535
10904 } 11536 }
10905 11537
10906 /** 11538 /**
10907 * A class that supports listening for and dispatching events that can fire when 11539 * A class that supports listening for and dispatching events that can fire when
10908 * making an HTTP request. 11540 * making an HTTP request.
10909 * 11541 *
10910 * Here's an example of adding an event handler that executes once an HTTP 11542 * Here's an example of adding an event handler that executes once an HTTP
10911 * request has fully loaded: 11543 * request has fully loaded:
10912 * 11544 *
10913 * httpRequest.on.loadEnd.add((e) => myCustomLoadEndHandler(e)); 11545 * httpRequest.on.loadEnd.add((e) => myCustomLoadEndHandler(e));
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
11012 final int totalSize; 11644 final int totalSize;
11013 } 11645 }
11014 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 11646 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
11015 // for details. All rights reserved. Use of this source code is governed by a 11647 // for details. All rights reserved. Use of this source code is governed by a
11016 // BSD-style license that can be found in the LICENSE file. 11648 // BSD-style license that can be found in the LICENSE file.
11017 11649
11018 11650
11019 /// @domName XMLHttpRequestUpload; @docsEditable true 11651 /// @domName XMLHttpRequestUpload; @docsEditable true
11020 class HttpRequestUpload extends EventTarget native "*XMLHttpRequestUpload" { 11652 class HttpRequestUpload extends EventTarget native "*XMLHttpRequestUpload" {
11021 11653
11654 static const EventStreamProvider<ProgressEvent> abortEvent = const EventStream Provider<ProgressEvent>('abort');
11655
11656 static const EventStreamProvider<ProgressEvent> errorEvent = const EventStream Provider<ProgressEvent>('error');
11657
11658 static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamP rovider<ProgressEvent>('load');
11659
11660 static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStre amProvider<ProgressEvent>('loadend');
11661
11662 static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventSt reamProvider<ProgressEvent>('loadstart');
11663
11664 static const EventStreamProvider<ProgressEvent> progressEvent = const EventStr eamProvider<ProgressEvent>('progress');
11665
11022 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 11666 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
11023 HttpRequestUploadEvents get on => 11667 HttpRequestUploadEvents get on =>
11024 new HttpRequestUploadEvents(this); 11668 new HttpRequestUploadEvents(this);
11025 11669
11026 /// @domName XMLHttpRequestUpload.addEventListener; @docsEditable true 11670 /// @domName XMLHttpRequestUpload.addEventListener; @docsEditable true
11027 @JSName('addEventListener') 11671 @JSName('addEventListener')
11028 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 11672 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
11029 11673
11030 /// @domName XMLHttpRequestUpload.dispatchEvent; @docsEditable true 11674 /// @domName XMLHttpRequestUpload.dispatchEvent; @docsEditable true
11031 @JSName('dispatchEvent') 11675 @JSName('dispatchEvent')
11032 bool $dom_dispatchEvent(Event evt) native; 11676 bool $dom_dispatchEvent(Event evt) native;
11033 11677
11034 /// @domName XMLHttpRequestUpload.removeEventListener; @docsEditable true 11678 /// @domName XMLHttpRequestUpload.removeEventListener; @docsEditable true
11035 @JSName('removeEventListener') 11679 @JSName('removeEventListener')
11036 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 11680 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
11681
11682 Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
11683
11684 Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
11685
11686 Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
11687
11688 Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
11689
11690 Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
11691
11692 Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
11037 } 11693 }
11038 11694
11039 /// @docsEditable true 11695 /// @docsEditable true
11040 class HttpRequestUploadEvents extends Events { 11696 class HttpRequestUploadEvents extends Events {
11041 /// @docsEditable true 11697 /// @docsEditable true
11042 HttpRequestUploadEvents(EventTarget _ptr) : super(_ptr); 11698 HttpRequestUploadEvents(EventTarget _ptr) : super(_ptr);
11043 11699
11044 /// @docsEditable true 11700 /// @docsEditable true
11045 EventListenerList get abort => this['abort']; 11701 EventListenerList get abort => this['abort'];
11046 11702
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
11206 var e = document.$dom_createElement("input"); 11862 var e = document.$dom_createElement("input");
11207 if (type != null) { 11863 if (type != null) {
11208 try { 11864 try {
11209 // IE throws an exception for unknown types. 11865 // IE throws an exception for unknown types.
11210 e.type = type; 11866 e.type = type;
11211 } catch(_) {} 11867 } catch(_) {}
11212 } 11868 }
11213 return e; 11869 return e;
11214 } 11870 }
11215 11871
11872 static const EventStreamProvider<Event> speechChangeEvent = const EventStreamP rovider<Event>('webkitSpeechChange');
11873
11216 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 11874 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
11217 InputElementEvents get on => 11875 InputElementEvents get on =>
11218 new InputElementEvents(this); 11876 new InputElementEvents(this);
11219 11877
11220 /// @domName HTMLInputElement.accept; @docsEditable true 11878 /// @domName HTMLInputElement.accept; @docsEditable true
11221 String accept; 11879 String accept;
11222 11880
11223 /// @domName HTMLInputElement.alt; @docsEditable true 11881 /// @domName HTMLInputElement.alt; @docsEditable true
11224 String alt; 11882 String alt;
11225 11883
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
11381 12039
11382 /// @domName HTMLInputElement.setSelectionRange; @docsEditable true 12040 /// @domName HTMLInputElement.setSelectionRange; @docsEditable true
11383 void setSelectionRange(int start, int end, [String direction]) native; 12041 void setSelectionRange(int start, int end, [String direction]) native;
11384 12042
11385 /// @domName HTMLInputElement.stepDown; @docsEditable true 12043 /// @domName HTMLInputElement.stepDown; @docsEditable true
11386 void stepDown([int n]) native; 12044 void stepDown([int n]) native;
11387 12045
11388 /// @domName HTMLInputElement.stepUp; @docsEditable true 12046 /// @domName HTMLInputElement.stepUp; @docsEditable true
11389 void stepUp([int n]) native; 12047 void stepUp([int n]) native;
11390 12048
12049 Stream<Event> get onSpeechChange => speechChangeEvent.forTarget(this);
12050
11391 } 12051 }
11392 12052
11393 12053
11394 // Interfaces representing the InputElement APIs which are supported 12054 // Interfaces representing the InputElement APIs which are supported
11395 // for the various types of InputElement. 12055 // for the various types of InputElement.
11396 // From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element. 12056 // From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element.
11397 12057
11398 /** 12058 /**
11399 * Exposes the functionality common between all InputElement types. 12059 * Exposes the functionality common between all InputElement types.
11400 */ 12060 */
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
12958 void unpause() native; 13618 void unpause() native;
12959 } 13619 }
12960 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 13620 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
12961 // for details. All rights reserved. Use of this source code is governed by a 13621 // for details. All rights reserved. Use of this source code is governed by a
12962 // BSD-style license that can be found in the LICENSE file. 13622 // BSD-style license that can be found in the LICENSE file.
12963 13623
12964 13624
12965 /// @domName HTMLMediaElement; @docsEditable true 13625 /// @domName HTMLMediaElement; @docsEditable true
12966 class MediaElement extends Element native "*HTMLMediaElement" { 13626 class MediaElement extends Element native "*HTMLMediaElement" {
12967 13627
13628 static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvid er<Event>('canplay');
13629
13630 static const EventStreamProvider<Event> canPlayThroughEvent = const EventStrea mProvider<Event>('canplaythrough');
13631
13632 static const EventStreamProvider<Event> durationChangeEvent = const EventStrea mProvider<Event>('durationchange');
13633
13634 static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvid er<Event>('emptied');
13635
13636 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider <Event>('ended');
13637
13638 static const EventStreamProvider<Event> loadedDataEvent = const EventStreamPro vider<Event>('loadeddata');
13639
13640 static const EventStreamProvider<Event> loadedMetadataEvent = const EventStrea mProvider<Event>('loadedmetadata');
13641
13642 static const EventStreamProvider<Event> loadStartEvent = const EventStreamProv ider<Event>('loadstart');
13643
13644 static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider <Event>('pause');
13645
13646 static const EventStreamProvider<Event> playEvent = const EventStreamProvider< Event>('play');
13647
13648 static const EventStreamProvider<Event> playingEvent = const EventStreamProvid er<Event>('playing');
13649
13650 static const EventStreamProvider<Event> progressEvent = const EventStreamProvi der<Event>('progress');
13651
13652 static const EventStreamProvider<Event> rateChangeEvent = const EventStreamPro vider<Event>('ratechange');
13653
13654 static const EventStreamProvider<Event> seekedEvent = const EventStreamProvide r<Event>('seeked');
13655
13656 static const EventStreamProvider<Event> seekingEvent = const EventStreamProvid er<Event>('seeking');
13657
13658 static const EventStreamProvider<Event> showEvent = const EventStreamProvider< Event>('show');
13659
13660 static const EventStreamProvider<Event> stalledEvent = const EventStreamProvid er<Event>('stalled');
13661
13662 static const EventStreamProvider<Event> suspendEvent = const EventStreamProvid er<Event>('suspend');
13663
13664 static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamPro vider<Event>('timeupdate');
13665
13666 static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamP rovider<Event>('volumechange');
13667
13668 static const EventStreamProvider<Event> waitingEvent = const EventStreamProvid er<Event>('waiting');
13669
13670 static const EventStreamProvider<MediaKeyEvent> keyAddedEvent = const EventStr eamProvider<MediaKeyEvent>('webkitkeyadded');
13671
13672 static const EventStreamProvider<MediaKeyEvent> keyErrorEvent = const EventStr eamProvider<MediaKeyEvent>('webkitkeyerror');
13673
13674 static const EventStreamProvider<MediaKeyEvent> keyMessageEvent = const EventS treamProvider<MediaKeyEvent>('webkitkeymessage');
13675
13676 static const EventStreamProvider<MediaKeyEvent> needKeyEvent = const EventStre amProvider<MediaKeyEvent>('webkitneedkey');
13677
12968 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 13678 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
12969 MediaElementEvents get on => 13679 MediaElementEvents get on =>
12970 new MediaElementEvents(this); 13680 new MediaElementEvents(this);
12971 13681
12972 static const int HAVE_CURRENT_DATA = 2; 13682 static const int HAVE_CURRENT_DATA = 2;
12973 13683
12974 static const int HAVE_ENOUGH_DATA = 4; 13684 static const int HAVE_ENOUGH_DATA = 4;
12975 13685
12976 static const int HAVE_FUTURE_DATA = 3; 13686 static const int HAVE_FUTURE_DATA = 3;
12977 13687
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
13099 void play() native; 13809 void play() native;
13100 13810
13101 /// @domName HTMLMediaElement.webkitAddKey; @docsEditable true 13811 /// @domName HTMLMediaElement.webkitAddKey; @docsEditable true
13102 void webkitAddKey(String keySystem, Uint8Array key, [Uint8Array initData, Stri ng sessionId]) native; 13812 void webkitAddKey(String keySystem, Uint8Array key, [Uint8Array initData, Stri ng sessionId]) native;
13103 13813
13104 /// @domName HTMLMediaElement.webkitCancelKeyRequest; @docsEditable true 13814 /// @domName HTMLMediaElement.webkitCancelKeyRequest; @docsEditable true
13105 void webkitCancelKeyRequest(String keySystem, String sessionId) native; 13815 void webkitCancelKeyRequest(String keySystem, String sessionId) native;
13106 13816
13107 /// @domName HTMLMediaElement.webkitGenerateKeyRequest; @docsEditable true 13817 /// @domName HTMLMediaElement.webkitGenerateKeyRequest; @docsEditable true
13108 void webkitGenerateKeyRequest(String keySystem, [Uint8Array initData]) native; 13818 void webkitGenerateKeyRequest(String keySystem, [Uint8Array initData]) native;
13819
13820 Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
13821
13822 Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
13823
13824 Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
13825
13826 Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
13827
13828 Stream<Event> get onEnded => endedEvent.forTarget(this);
13829
13830 Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
13831
13832 Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
13833
13834 Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
13835
13836 Stream<Event> get onPause => pauseEvent.forTarget(this);
13837
13838 Stream<Event> get onPlay => playEvent.forTarget(this);
13839
13840 Stream<Event> get onPlaying => playingEvent.forTarget(this);
13841
13842 Stream<Event> get onProgress => progressEvent.forTarget(this);
13843
13844 Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
13845
13846 Stream<Event> get onSeeked => seekedEvent.forTarget(this);
13847
13848 Stream<Event> get onSeeking => seekingEvent.forTarget(this);
13849
13850 Stream<Event> get onShow => showEvent.forTarget(this);
13851
13852 Stream<Event> get onStalled => stalledEvent.forTarget(this);
13853
13854 Stream<Event> get onSuspend => suspendEvent.forTarget(this);
13855
13856 Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
13857
13858 Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
13859
13860 Stream<Event> get onWaiting => waitingEvent.forTarget(this);
13861
13862 Stream<MediaKeyEvent> get onKeyAdded => keyAddedEvent.forTarget(this);
13863
13864 Stream<MediaKeyEvent> get onKeyError => keyErrorEvent.forTarget(this);
13865
13866 Stream<MediaKeyEvent> get onKeyMessage => keyMessageEvent.forTarget(this);
13867
13868 Stream<MediaKeyEvent> get onNeedKey => needKeyEvent.forTarget(this);
13109 } 13869 }
13110 13870
13111 /// @docsEditable true 13871 /// @docsEditable true
13112 class MediaElementEvents extends ElementEvents { 13872 class MediaElementEvents extends ElementEvents {
13113 /// @docsEditable true 13873 /// @docsEditable true
13114 MediaElementEvents(EventTarget _ptr) : super(_ptr); 13874 MediaElementEvents(EventTarget _ptr) : super(_ptr);
13115 13875
13116 /// @docsEditable true 13876 /// @docsEditable true
13117 EventListenerList get canPlay => this['canplay']; 13877 EventListenerList get canPlay => this['canplay'];
13118 13878
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
13362 void removeSourceBuffer(SourceBuffer buffer) native; 14122 void removeSourceBuffer(SourceBuffer buffer) native;
13363 } 14123 }
13364 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14124 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13365 // for details. All rights reserved. Use of this source code is governed by a 14125 // for details. All rights reserved. Use of this source code is governed by a
13366 // BSD-style license that can be found in the LICENSE file. 14126 // BSD-style license that can be found in the LICENSE file.
13367 14127
13368 14128
13369 /// @domName MediaStream; @docsEditable true 14129 /// @domName MediaStream; @docsEditable true
13370 class MediaStream extends EventTarget native "*MediaStream" { 14130 class MediaStream extends EventTarget native "*MediaStream" {
13371 14131
14132 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider <Event>('ended');
14133
13372 ///@docsEditable true 14134 ///@docsEditable true
13373 factory MediaStream(MediaStreamTrackList audioTracks, MediaStreamTrackList vid eoTracks) => MediaStream._create(audioTracks, videoTracks); 14135 factory MediaStream(MediaStreamTrackList audioTracks, MediaStreamTrackList vid eoTracks) => MediaStream._create(audioTracks, videoTracks);
13374 static MediaStream _create(MediaStreamTrackList audioTracks, MediaStreamTrackL ist videoTracks) => JS('MediaStream', 'new MediaStream(#,#)', audioTracks, video Tracks); 14136 static MediaStream _create(MediaStreamTrackList audioTracks, MediaStreamTrackL ist videoTracks) => JS('MediaStream', 'new MediaStream(#,#)', audioTracks, video Tracks);
13375 14137
13376 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 14138 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
13377 MediaStreamEvents get on => 14139 MediaStreamEvents get on =>
13378 new MediaStreamEvents(this); 14140 new MediaStreamEvents(this);
13379 14141
13380 static const int ENDED = 2; 14142 static const int ENDED = 2;
13381 14143
(...skipping 15 matching lines...) Expand all
13397 @JSName('addEventListener') 14159 @JSName('addEventListener')
13398 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 14160 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
13399 14161
13400 /// @domName MediaStream.dispatchEvent; @docsEditable true 14162 /// @domName MediaStream.dispatchEvent; @docsEditable true
13401 @JSName('dispatchEvent') 14163 @JSName('dispatchEvent')
13402 bool $dom_dispatchEvent(Event event) native; 14164 bool $dom_dispatchEvent(Event event) native;
13403 14165
13404 /// @domName MediaStream.removeEventListener; @docsEditable true 14166 /// @domName MediaStream.removeEventListener; @docsEditable true
13405 @JSName('removeEventListener') 14167 @JSName('removeEventListener')
13406 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 14168 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
14169
14170 Stream<Event> get onEnded => endedEvent.forTarget(this);
13407 } 14171 }
13408 14172
13409 /// @docsEditable true 14173 /// @docsEditable true
13410 class MediaStreamEvents extends Events { 14174 class MediaStreamEvents extends Events {
13411 /// @docsEditable true 14175 /// @docsEditable true
13412 MediaStreamEvents(EventTarget _ptr) : super(_ptr); 14176 MediaStreamEvents(EventTarget _ptr) : super(_ptr);
13413 14177
13414 /// @docsEditable true 14178 /// @docsEditable true
13415 EventListenerList get ended => this['ended']; 14179 EventListenerList get ended => this['ended'];
13416 } 14180 }
13417 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14181 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13418 // for details. All rights reserved. Use of this source code is governed by a 14182 // for details. All rights reserved. Use of this source code is governed by a
13419 // BSD-style license that can be found in the LICENSE file. 14183 // BSD-style license that can be found in the LICENSE file.
13420 14184
13421 14185
13422 /// @domName MediaStreamEvent; @docsEditable true 14186 /// @domName MediaStreamEvent; @docsEditable true
13423 class MediaStreamEvent extends Event native "*MediaStreamEvent" { 14187 class MediaStreamEvent extends Event native "*MediaStreamEvent" {
13424 14188
13425 /// @domName MediaStreamEvent.stream; @docsEditable true 14189 /// @domName MediaStreamEvent.stream; @docsEditable true
13426 final MediaStream stream; 14190 final MediaStream stream;
13427 } 14191 }
13428 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14192 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13429 // for details. All rights reserved. Use of this source code is governed by a 14193 // for details. All rights reserved. Use of this source code is governed by a
13430 // BSD-style license that can be found in the LICENSE file. 14194 // BSD-style license that can be found in the LICENSE file.
13431 14195
13432 14196
13433 /// @domName MediaStreamTrack; @docsEditable true 14197 /// @domName MediaStreamTrack; @docsEditable true
13434 class MediaStreamTrack extends EventTarget native "*MediaStreamTrack" { 14198 class MediaStreamTrack extends EventTarget native "*MediaStreamTrack" {
13435 14199
14200 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider <Event>('ended');
14201
14202 static const EventStreamProvider<Event> muteEvent = const EventStreamProvider< Event>('mute');
14203
14204 static const EventStreamProvider<Event> unmuteEvent = const EventStreamProvide r<Event>('unmute');
14205
13436 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 14206 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
13437 MediaStreamTrackEvents get on => 14207 MediaStreamTrackEvents get on =>
13438 new MediaStreamTrackEvents(this); 14208 new MediaStreamTrackEvents(this);
13439 14209
13440 static const int ENDED = 2; 14210 static const int ENDED = 2;
13441 14211
13442 static const int LIVE = 0; 14212 static const int LIVE = 0;
13443 14213
13444 static const int MUTED = 1; 14214 static const int MUTED = 1;
13445 14215
(...skipping 13 matching lines...) Expand all
13459 @JSName('addEventListener') 14229 @JSName('addEventListener')
13460 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 14230 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
13461 14231
13462 /// @domName MediaStreamTrack.dispatchEvent; @docsEditable true 14232 /// @domName MediaStreamTrack.dispatchEvent; @docsEditable true
13463 @JSName('dispatchEvent') 14233 @JSName('dispatchEvent')
13464 bool $dom_dispatchEvent(Event event) native; 14234 bool $dom_dispatchEvent(Event event) native;
13465 14235
13466 /// @domName MediaStreamTrack.removeEventListener; @docsEditable true 14236 /// @domName MediaStreamTrack.removeEventListener; @docsEditable true
13467 @JSName('removeEventListener') 14237 @JSName('removeEventListener')
13468 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 14238 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
14239
14240 Stream<Event> get onEnded => endedEvent.forTarget(this);
14241
14242 Stream<Event> get onMute => muteEvent.forTarget(this);
14243
14244 Stream<Event> get onUnmute => unmuteEvent.forTarget(this);
13469 } 14245 }
13470 14246
13471 /// @docsEditable true 14247 /// @docsEditable true
13472 class MediaStreamTrackEvents extends Events { 14248 class MediaStreamTrackEvents extends Events {
13473 /// @docsEditable true 14249 /// @docsEditable true
13474 MediaStreamTrackEvents(EventTarget _ptr) : super(_ptr); 14250 MediaStreamTrackEvents(EventTarget _ptr) : super(_ptr);
13475 14251
13476 /// @docsEditable true 14252 /// @docsEditable true
13477 EventListenerList get ended => this['ended']; 14253 EventListenerList get ended => this['ended'];
13478 14254
(...skipping 15 matching lines...) Expand all
13494 final MediaStreamTrack track; 14270 final MediaStreamTrack track;
13495 } 14271 }
13496 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14272 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13497 // for details. All rights reserved. Use of this source code is governed by a 14273 // for details. All rights reserved. Use of this source code is governed by a
13498 // BSD-style license that can be found in the LICENSE file. 14274 // BSD-style license that can be found in the LICENSE file.
13499 14275
13500 14276
13501 /// @domName MediaStreamTrackList; @docsEditable true 14277 /// @domName MediaStreamTrackList; @docsEditable true
13502 class MediaStreamTrackList extends EventTarget native "*MediaStreamTrackList" { 14278 class MediaStreamTrackList extends EventTarget native "*MediaStreamTrackList" {
13503 14279
14280 static const EventStreamProvider<MediaStreamTrackEvent> addTrackEvent = const EventStreamProvider<MediaStreamTrackEvent>('addtrack');
14281
14282 static const EventStreamProvider<MediaStreamTrackEvent> removeTrackEvent = con st EventStreamProvider<MediaStreamTrackEvent>('removetrack');
14283
13504 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 14284 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
13505 MediaStreamTrackListEvents get on => 14285 MediaStreamTrackListEvents get on =>
13506 new MediaStreamTrackListEvents(this); 14286 new MediaStreamTrackListEvents(this);
13507 14287
13508 /// @domName MediaStreamTrackList.length; @docsEditable true 14288 /// @domName MediaStreamTrackList.length; @docsEditable true
13509 final int length; 14289 final int length;
13510 14290
13511 /// @domName MediaStreamTrackList.add; @docsEditable true 14291 /// @domName MediaStreamTrackList.add; @docsEditable true
13512 void add(MediaStreamTrack track) native; 14292 void add(MediaStreamTrack track) native;
13513 14293
13514 /// @domName MediaStreamTrackList.addEventListener; @docsEditable true 14294 /// @domName MediaStreamTrackList.addEventListener; @docsEditable true
13515 @JSName('addEventListener') 14295 @JSName('addEventListener')
13516 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 14296 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
13517 14297
13518 /// @domName MediaStreamTrackList.dispatchEvent; @docsEditable true 14298 /// @domName MediaStreamTrackList.dispatchEvent; @docsEditable true
13519 @JSName('dispatchEvent') 14299 @JSName('dispatchEvent')
13520 bool $dom_dispatchEvent(Event event) native; 14300 bool $dom_dispatchEvent(Event event) native;
13521 14301
13522 /// @domName MediaStreamTrackList.item; @docsEditable true 14302 /// @domName MediaStreamTrackList.item; @docsEditable true
13523 MediaStreamTrack item(int index) native; 14303 MediaStreamTrack item(int index) native;
13524 14304
13525 /// @domName MediaStreamTrackList.remove; @docsEditable true 14305 /// @domName MediaStreamTrackList.remove; @docsEditable true
13526 void remove(MediaStreamTrack track) native; 14306 void remove(MediaStreamTrack track) native;
13527 14307
13528 /// @domName MediaStreamTrackList.removeEventListener; @docsEditable true 14308 /// @domName MediaStreamTrackList.removeEventListener; @docsEditable true
13529 @JSName('removeEventListener') 14309 @JSName('removeEventListener')
13530 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 14310 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
14311
14312 Stream<MediaStreamTrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
14313
14314 Stream<MediaStreamTrackEvent> get onRemoveTrack => removeTrackEvent.forTarget( this);
13531 } 14315 }
13532 14316
13533 /// @docsEditable true 14317 /// @docsEditable true
13534 class MediaStreamTrackListEvents extends Events { 14318 class MediaStreamTrackListEvents extends Events {
13535 /// @docsEditable true 14319 /// @docsEditable true
13536 MediaStreamTrackListEvents(EventTarget _ptr) : super(_ptr); 14320 MediaStreamTrackListEvents(EventTarget _ptr) : super(_ptr);
13537 14321
13538 /// @docsEditable true 14322 /// @docsEditable true
13539 EventListenerList get addTrack => this['addtrack']; 14323 EventListenerList get addTrack => this['addtrack'];
13540 14324
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
13634 void webkitInitMessageEvent(String typeArg, bool canBubbleArg, bool cancelable Arg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List transferables) native; 14418 void webkitInitMessageEvent(String typeArg, bool canBubbleArg, bool cancelable Arg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List transferables) native;
13635 } 14419 }
13636 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14420 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
13637 // for details. All rights reserved. Use of this source code is governed by a 14421 // for details. All rights reserved. Use of this source code is governed by a
13638 // BSD-style license that can be found in the LICENSE file. 14422 // BSD-style license that can be found in the LICENSE file.
13639 14423
13640 14424
13641 /// @domName MessagePort; @docsEditable true 14425 /// @domName MessagePort; @docsEditable true
13642 class MessagePort extends EventTarget native "*MessagePort" { 14426 class MessagePort extends EventTarget native "*MessagePort" {
13643 14427
14428 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
14429
13644 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 14430 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
13645 MessagePortEvents get on => 14431 MessagePortEvents get on =>
13646 new MessagePortEvents(this); 14432 new MessagePortEvents(this);
13647 14433
13648 /// @domName MessagePort.addEventListener; @docsEditable true 14434 /// @domName MessagePort.addEventListener; @docsEditable true
13649 @JSName('addEventListener') 14435 @JSName('addEventListener')
13650 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 14436 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
13651 14437
13652 /// @domName MessagePort.close; @docsEditable true 14438 /// @domName MessagePort.close; @docsEditable true
13653 void close() native; 14439 void close() native;
(...skipping 17 matching lines...) Expand all
13671 void _postMessage_1(message, List messagePorts) native; 14457 void _postMessage_1(message, List messagePorts) native;
13672 @JSName('postMessage') 14458 @JSName('postMessage')
13673 void _postMessage_2(message) native; 14459 void _postMessage_2(message) native;
13674 14460
13675 /// @domName MessagePort.removeEventListener; @docsEditable true 14461 /// @domName MessagePort.removeEventListener; @docsEditable true
13676 @JSName('removeEventListener') 14462 @JSName('removeEventListener')
13677 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 14463 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
13678 14464
13679 /// @domName MessagePort.start; @docsEditable true 14465 /// @domName MessagePort.start; @docsEditable true
13680 void start() native; 14466 void start() native;
14467
14468 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
13681 } 14469 }
13682 14470
13683 /// @docsEditable true 14471 /// @docsEditable true
13684 class MessagePortEvents extends Events { 14472 class MessagePortEvents extends Events {
13685 /// @docsEditable true 14473 /// @docsEditable true
13686 MessagePortEvents(EventTarget _ptr) : super(_ptr); 14474 MessagePortEvents(EventTarget _ptr) : super(_ptr);
13687 14475
13688 /// @docsEditable true 14476 /// @docsEditable true
13689 EventListenerList get message => this['message']; 14477 EventListenerList get message => this['message'];
13690 } 14478 }
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after
14977 final String systemId; 15765 final String systemId;
14978 } 15766 }
14979 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15767 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
14980 // for details. All rights reserved. Use of this source code is governed by a 15768 // for details. All rights reserved. Use of this source code is governed by a
14981 // BSD-style license that can be found in the LICENSE file. 15769 // BSD-style license that can be found in the LICENSE file.
14982 15770
14983 15771
14984 /// @domName Notification; @docsEditable true 15772 /// @domName Notification; @docsEditable true
14985 class Notification extends EventTarget native "*Notification" { 15773 class Notification extends EventTarget native "*Notification" {
14986 15774
15775 static const EventStreamProvider<Event> clickEvent = const EventStreamProvider <Event>('click');
15776
15777 static const EventStreamProvider<Event> closeEvent = const EventStreamProvider <Event>('close');
15778
15779 static const EventStreamProvider<Event> displayEvent = const EventStreamProvid er<Event>('display');
15780
15781 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
15782
15783 static const EventStreamProvider<Event> showEvent = const EventStreamProvider< Event>('show');
15784
14987 ///@docsEditable true 15785 ///@docsEditable true
14988 factory Notification(String title, [Map options]) { 15786 factory Notification(String title, [Map options]) {
14989 if (!?options) { 15787 if (!?options) {
14990 return Notification._create(title); 15788 return Notification._create(title);
14991 } 15789 }
14992 return Notification._create(title, options); 15790 return Notification._create(title, options);
14993 } 15791 }
14994 static Notification _create(String title, [Map options]) { 15792 static Notification _create(String title, [Map options]) {
14995 if (!?options) { 15793 if (!?options) {
14996 return JS('Notification', 'new Notification(#)', title); 15794 return JS('Notification', 'new Notification(#)', title);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
15030 15828
15031 /// @domName Notification.removeEventListener; @docsEditable true 15829 /// @domName Notification.removeEventListener; @docsEditable true
15032 @JSName('removeEventListener') 15830 @JSName('removeEventListener')
15033 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 15831 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
15034 15832
15035 /// @domName Notification.requestPermission; @docsEditable true 15833 /// @domName Notification.requestPermission; @docsEditable true
15036 static void requestPermission(NotificationPermissionCallback callback) native; 15834 static void requestPermission(NotificationPermissionCallback callback) native;
15037 15835
15038 /// @domName Notification.show; @docsEditable true 15836 /// @domName Notification.show; @docsEditable true
15039 void show() native; 15837 void show() native;
15838
15839 Stream<Event> get onClick => clickEvent.forTarget(this);
15840
15841 Stream<Event> get onClose => closeEvent.forTarget(this);
15842
15843 Stream<Event> get onDisplay => displayEvent.forTarget(this);
15844
15845 Stream<Event> get onError => errorEvent.forTarget(this);
15846
15847 Stream<Event> get onShow => showEvent.forTarget(this);
15040 } 15848 }
15041 15849
15042 /// @docsEditable true 15850 /// @docsEditable true
15043 class NotificationEvents extends Events { 15851 class NotificationEvents extends Events {
15044 /// @docsEditable true 15852 /// @docsEditable true
15045 NotificationEvents(EventTarget _ptr) : super(_ptr); 15853 NotificationEvents(EventTarget _ptr) : super(_ptr);
15046 15854
15047 /// @docsEditable true 15855 /// @docsEditable true
15048 EventListenerList get click => this['click']; 15856 EventListenerList get click => this['click'];
15049 15857
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
15935 final CssPrimitiveValue red; 16743 final CssPrimitiveValue red;
15936 } 16744 }
15937 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 16745 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15938 // for details. All rights reserved. Use of this source code is governed by a 16746 // for details. All rights reserved. Use of this source code is governed by a
15939 // BSD-style license that can be found in the LICENSE file. 16747 // BSD-style license that can be found in the LICENSE file.
15940 16748
15941 16749
15942 /// @domName RTCDataChannel; @docsEditable true 16750 /// @domName RTCDataChannel; @docsEditable true
15943 class RtcDataChannel extends EventTarget native "*RTCDataChannel" { 16751 class RtcDataChannel extends EventTarget native "*RTCDataChannel" {
15944 16752
16753 static const EventStreamProvider<Event> closeEvent = const EventStreamProvider <Event>('close');
16754
16755 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
16756
16757 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
16758
16759 static const EventStreamProvider<Event> openEvent = const EventStreamProvider< Event>('open');
16760
15945 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 16761 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
15946 RtcDataChannelEvents get on => 16762 RtcDataChannelEvents get on =>
15947 new RtcDataChannelEvents(this); 16763 new RtcDataChannelEvents(this);
15948 16764
15949 /// @domName RTCDataChannel.binaryType; @docsEditable true 16765 /// @domName RTCDataChannel.binaryType; @docsEditable true
15950 String binaryType; 16766 String binaryType;
15951 16767
15952 /// @domName RTCDataChannel.bufferedAmount; @docsEditable true 16768 /// @domName RTCDataChannel.bufferedAmount; @docsEditable true
15953 final int bufferedAmount; 16769 final int bufferedAmount;
15954 16770
(...skipping 16 matching lines...) Expand all
15971 /// @domName RTCDataChannel.dispatchEvent; @docsEditable true 16787 /// @domName RTCDataChannel.dispatchEvent; @docsEditable true
15972 @JSName('dispatchEvent') 16788 @JSName('dispatchEvent')
15973 bool $dom_dispatchEvent(Event event) native; 16789 bool $dom_dispatchEvent(Event event) native;
15974 16790
15975 /// @domName RTCDataChannel.removeEventListener; @docsEditable true 16791 /// @domName RTCDataChannel.removeEventListener; @docsEditable true
15976 @JSName('removeEventListener') 16792 @JSName('removeEventListener')
15977 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 16793 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
15978 16794
15979 /// @domName RTCDataChannel.send; @docsEditable true 16795 /// @domName RTCDataChannel.send; @docsEditable true
15980 void send(data) native; 16796 void send(data) native;
16797
16798 Stream<Event> get onClose => closeEvent.forTarget(this);
16799
16800 Stream<Event> get onError => errorEvent.forTarget(this);
16801
16802 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
16803
16804 Stream<Event> get onOpen => openEvent.forTarget(this);
15981 } 16805 }
15982 16806
15983 /// @docsEditable true 16807 /// @docsEditable true
15984 class RtcDataChannelEvents extends Events { 16808 class RtcDataChannelEvents extends Events {
15985 /// @docsEditable true 16809 /// @docsEditable true
15986 RtcDataChannelEvents(EventTarget _ptr) : super(_ptr); 16810 RtcDataChannelEvents(EventTarget _ptr) : super(_ptr);
15987 16811
15988 /// @docsEditable true 16812 /// @docsEditable true
15989 EventListenerList get close => this['close']; 16813 EventListenerList get close => this['close'];
15990 16814
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
16041 final RtcIceCandidate candidate; 16865 final RtcIceCandidate candidate;
16042 } 16866 }
16043 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 16867 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
16044 // for details. All rights reserved. Use of this source code is governed by a 16868 // for details. All rights reserved. Use of this source code is governed by a
16045 // BSD-style license that can be found in the LICENSE file. 16869 // BSD-style license that can be found in the LICENSE file.
16046 16870
16047 16871
16048 /// @domName RTCPeerConnection; @docsEditable true 16872 /// @domName RTCPeerConnection; @docsEditable true
16049 class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" { 16873 class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
16050 16874
16875 static const EventStreamProvider<MediaStreamEvent> addStreamEvent = const Even tStreamProvider<MediaStreamEvent>('addstream');
16876
16877 static const EventStreamProvider<RtcDataChannelEvent> dataChannelEvent = const EventStreamProvider<RtcDataChannelEvent>('datachannel');
16878
16879 static const EventStreamProvider<RtcIceCandidateEvent> iceCandidateEvent = con st EventStreamProvider<RtcIceCandidateEvent>('icecandidate');
16880
16881 static const EventStreamProvider<Event> iceChangeEvent = const EventStreamProv ider<Event>('icechange');
16882
16883 static const EventStreamProvider<Event> negotiationNeededEvent = const EventSt reamProvider<Event>('negotiationneeded');
16884
16885 static const EventStreamProvider<Event> openEvent = const EventStreamProvider< Event>('open');
16886
16887 static const EventStreamProvider<MediaStreamEvent> removeStreamEvent = const E ventStreamProvider<MediaStreamEvent>('removestream');
16888
16889 static const EventStreamProvider<Event> stateChangeEvent = const EventStreamPr ovider<Event>('statechange');
16890
16051 ///@docsEditable true 16891 ///@docsEditable true
16052 factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) { 16892 factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
16053 if (!?mediaConstraints) { 16893 if (!?mediaConstraints) {
16054 return RtcPeerConnection._create(rtcIceServers); 16894 return RtcPeerConnection._create(rtcIceServers);
16055 } 16895 }
16056 return RtcPeerConnection._create(rtcIceServers, mediaConstraints); 16896 return RtcPeerConnection._create(rtcIceServers, mediaConstraints);
16057 } 16897 }
16058 static RtcPeerConnection _create(Map rtcIceServers, [Map mediaConstraints]) { 16898 static RtcPeerConnection _create(Map rtcIceServers, [Map mediaConstraints]) {
16059 if (!?mediaConstraints) { 16899 if (!?mediaConstraints) {
16060 return JS('RtcPeerConnection', 'new RTCPeerConnection(#)', rtcIceServers); 16900 return JS('RtcPeerConnection', 'new RTCPeerConnection(#)', rtcIceServers);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
16192 } 17032 }
16193 _updateIce_3(); 17033 _updateIce_3();
16194 return; 17034 return;
16195 } 17035 }
16196 @JSName('updateIce') 17036 @JSName('updateIce')
16197 void _updateIce_1(configuration, mediaConstraints) native; 17037 void _updateIce_1(configuration, mediaConstraints) native;
16198 @JSName('updateIce') 17038 @JSName('updateIce')
16199 void _updateIce_2(configuration) native; 17039 void _updateIce_2(configuration) native;
16200 @JSName('updateIce') 17040 @JSName('updateIce')
16201 void _updateIce_3() native; 17041 void _updateIce_3() native;
17042
17043 Stream<MediaStreamEvent> get onAddStream => addStreamEvent.forTarget(this);
17044
17045 Stream<RtcDataChannelEvent> get onDataChannel => dataChannelEvent.forTarget(th is);
17046
17047 Stream<RtcIceCandidateEvent> get onIceCandidate => iceCandidateEvent.forTarget (this);
17048
17049 Stream<Event> get onIceChange => iceChangeEvent.forTarget(this);
17050
17051 Stream<Event> get onNegotiationNeeded => negotiationNeededEvent.forTarget(this );
17052
17053 Stream<Event> get onOpen => openEvent.forTarget(this);
17054
17055 Stream<MediaStreamEvent> get onRemoveStream => removeStreamEvent.forTarget(thi s);
17056
17057 Stream<Event> get onStateChange => stateChangeEvent.forTarget(this);
16202 } 17058 }
16203 17059
16204 /// @docsEditable true 17060 /// @docsEditable true
16205 class RtcPeerConnectionEvents extends Events { 17061 class RtcPeerConnectionEvents extends Events {
16206 /// @docsEditable true 17062 /// @docsEditable true
16207 RtcPeerConnectionEvents(EventTarget _ptr) : super(_ptr); 17063 RtcPeerConnectionEvents(EventTarget _ptr) : super(_ptr);
16208 17064
16209 /// @docsEditable true 17065 /// @docsEditable true
16210 EventListenerList get addStream => this['addstream']; 17066 EventListenerList get addStream => this['addstream'];
16211 17067
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
16630 final MessagePort port; 17486 final MessagePort port;
16631 } 17487 }
16632 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17488 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
16633 // for details. All rights reserved. Use of this source code is governed by a 17489 // for details. All rights reserved. Use of this source code is governed by a
16634 // BSD-style license that can be found in the LICENSE file. 17490 // BSD-style license that can be found in the LICENSE file.
16635 17491
16636 17492
16637 /// @domName SharedWorkerContext; @docsEditable true 17493 /// @domName SharedWorkerContext; @docsEditable true
16638 class SharedWorkerContext extends WorkerContext native "*SharedWorkerContext" { 17494 class SharedWorkerContext extends WorkerContext native "*SharedWorkerContext" {
16639 17495
17496 static const EventStreamProvider<Event> connectEvent = const EventStreamProvid er<Event>('connect');
17497
16640 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 17498 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
16641 SharedWorkerContextEvents get on => 17499 SharedWorkerContextEvents get on =>
16642 new SharedWorkerContextEvents(this); 17500 new SharedWorkerContextEvents(this);
16643 17501
16644 /// @domName SharedWorkerContext.name; @docsEditable true 17502 /// @domName SharedWorkerContext.name; @docsEditable true
16645 final String name; 17503 final String name;
17504
17505 Stream<Event> get onConnect => connectEvent.forTarget(this);
16646 } 17506 }
16647 17507
16648 /// @docsEditable true 17508 /// @docsEditable true
16649 class SharedWorkerContextEvents extends WorkerContextEvents { 17509 class SharedWorkerContextEvents extends WorkerContextEvents {
16650 /// @docsEditable true 17510 /// @docsEditable true
16651 SharedWorkerContextEvents(EventTarget _ptr) : super(_ptr); 17511 SharedWorkerContextEvents(EventTarget _ptr) : super(_ptr);
16652 17512
16653 /// @docsEditable true 17513 /// @docsEditable true
16654 EventListenerList get connect => this['connect']; 17514 EventListenerList get connect => this['connect'];
16655 } 17515 }
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
17089 final String utterance; 17949 final String utterance;
17090 } 17950 }
17091 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17951 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17092 // for details. All rights reserved. Use of this source code is governed by a 17952 // for details. All rights reserved. Use of this source code is governed by a
17093 // BSD-style license that can be found in the LICENSE file. 17953 // BSD-style license that can be found in the LICENSE file.
17094 17954
17095 17955
17096 /// @domName SpeechRecognition; @docsEditable true 17956 /// @domName SpeechRecognition; @docsEditable true
17097 class SpeechRecognition extends EventTarget native "*SpeechRecognition" { 17957 class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
17098 17958
17959 static const EventStreamProvider<Event> audioEndEvent = const EventStreamProvi der<Event>('audioend');
17960
17961 static const EventStreamProvider<Event> audioStartEvent = const EventStreamPro vider<Event>('audiostart');
17962
17963 static const EventStreamProvider<Event> endEvent = const EventStreamProvider<E vent>('end');
17964
17965 static const EventStreamProvider<SpeechRecognitionError> errorEvent = const Ev entStreamProvider<SpeechRecognitionError>('error');
17966
17967 static const EventStreamProvider<SpeechRecognitionEvent> noMatchEvent = const EventStreamProvider<SpeechRecognitionEvent>('nomatch');
17968
17969 static const EventStreamProvider<SpeechRecognitionEvent> resultEvent = const E ventStreamProvider<SpeechRecognitionEvent>('result');
17970
17971 static const EventStreamProvider<Event> soundEndEvent = const EventStreamProvi der<Event>('soundend');
17972
17973 static const EventStreamProvider<Event> soundStartEvent = const EventStreamPro vider<Event>('soundstart');
17974
17975 static const EventStreamProvider<Event> speechEndEvent = const EventStreamProv ider<Event>('speechend');
17976
17977 static const EventStreamProvider<Event> speechStartEvent = const EventStreamPr ovider<Event>('speechstart');
17978
17979 static const EventStreamProvider<Event> startEvent = const EventStreamProvider <Event>('start');
17980
17099 ///@docsEditable true 17981 ///@docsEditable true
17100 factory SpeechRecognition() => SpeechRecognition._create(); 17982 factory SpeechRecognition() => SpeechRecognition._create();
17101 static SpeechRecognition _create() => JS('SpeechRecognition', 'new SpeechRecog nition()'); 17983 static SpeechRecognition _create() => JS('SpeechRecognition', 'new SpeechRecog nition()');
17102 17984
17103 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 17985 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
17104 SpeechRecognitionEvents get on => 17986 SpeechRecognitionEvents get on =>
17105 new SpeechRecognitionEvents(this); 17987 new SpeechRecognitionEvents(this);
17106 17988
17107 /// @domName SpeechRecognition.continuous; @docsEditable true 17989 /// @domName SpeechRecognition.continuous; @docsEditable true
17108 bool continuous; 17990 bool continuous;
(...skipping 23 matching lines...) Expand all
17132 18014
17133 /// @domName SpeechRecognition.removeEventListener; @docsEditable true 18015 /// @domName SpeechRecognition.removeEventListener; @docsEditable true
17134 @JSName('removeEventListener') 18016 @JSName('removeEventListener')
17135 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 18017 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
17136 18018
17137 /// @domName SpeechRecognition.start; @docsEditable true 18019 /// @domName SpeechRecognition.start; @docsEditable true
17138 void start() native; 18020 void start() native;
17139 18021
17140 /// @domName SpeechRecognition.stop; @docsEditable true 18022 /// @domName SpeechRecognition.stop; @docsEditable true
17141 void stop() native; 18023 void stop() native;
18024
18025 Stream<Event> get onAudioEnd => audioEndEvent.forTarget(this);
18026
18027 Stream<Event> get onAudioStart => audioStartEvent.forTarget(this);
18028
18029 Stream<Event> get onEnd => endEvent.forTarget(this);
18030
18031 Stream<SpeechRecognitionError> get onError => errorEvent.forTarget(this);
18032
18033 Stream<SpeechRecognitionEvent> get onNoMatch => noMatchEvent.forTarget(this);
18034
18035 Stream<SpeechRecognitionEvent> get onResult => resultEvent.forTarget(this);
18036
18037 Stream<Event> get onSoundEnd => soundEndEvent.forTarget(this);
18038
18039 Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
18040
18041 Stream<Event> get onSpeechEnd => speechEndEvent.forTarget(this);
18042
18043 Stream<Event> get onSpeechStart => speechStartEvent.forTarget(this);
18044
18045 Stream<Event> get onStart => startEvent.forTarget(this);
17142 } 18046 }
17143 18047
17144 /// @docsEditable true 18048 /// @docsEditable true
17145 class SpeechRecognitionEvents extends Events { 18049 class SpeechRecognitionEvents extends Events {
17146 /// @docsEditable true 18050 /// @docsEditable true
17147 SpeechRecognitionEvents(EventTarget _ptr) : super(_ptr); 18051 SpeechRecognitionEvents(EventTarget _ptr) : super(_ptr);
17148 18052
17149 /// @docsEditable true 18053 /// @docsEditable true
17150 EventListenerList get audioEnd => this['audioend']; 18054 EventListenerList get audioEnd => this['audioend'];
17151 18055
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
18037 final num width; 18941 final num width;
18038 } 18942 }
18039 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 18943 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
18040 // for details. All rights reserved. Use of this source code is governed by a 18944 // for details. All rights reserved. Use of this source code is governed by a
18041 // BSD-style license that can be found in the LICENSE file. 18945 // BSD-style license that can be found in the LICENSE file.
18042 18946
18043 18947
18044 /// @domName TextTrack; @docsEditable true 18948 /// @domName TextTrack; @docsEditable true
18045 class TextTrack extends EventTarget native "*TextTrack" { 18949 class TextTrack extends EventTarget native "*TextTrack" {
18046 18950
18951 static const EventStreamProvider<Event> cueChangeEvent = const EventStreamProv ider<Event>('cuechange');
18952
18047 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 18953 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
18048 TextTrackEvents get on => 18954 TextTrackEvents get on =>
18049 new TextTrackEvents(this); 18955 new TextTrackEvents(this);
18050 18956
18051 /// @domName TextTrack.activeCues; @docsEditable true 18957 /// @domName TextTrack.activeCues; @docsEditable true
18052 final TextTrackCueList activeCues; 18958 final TextTrackCueList activeCues;
18053 18959
18054 /// @domName TextTrack.cues; @docsEditable true 18960 /// @domName TextTrack.cues; @docsEditable true
18055 final TextTrackCueList cues; 18961 final TextTrackCueList cues;
18056 18962
(...skipping 19 matching lines...) Expand all
18076 /// @domName TextTrack.dispatchEvent; @docsEditable true 18982 /// @domName TextTrack.dispatchEvent; @docsEditable true
18077 @JSName('dispatchEvent') 18983 @JSName('dispatchEvent')
18078 bool $dom_dispatchEvent(Event evt) native; 18984 bool $dom_dispatchEvent(Event evt) native;
18079 18985
18080 /// @domName TextTrack.removeCue; @docsEditable true 18986 /// @domName TextTrack.removeCue; @docsEditable true
18081 void removeCue(TextTrackCue cue) native; 18987 void removeCue(TextTrackCue cue) native;
18082 18988
18083 /// @domName TextTrack.removeEventListener; @docsEditable true 18989 /// @domName TextTrack.removeEventListener; @docsEditable true
18084 @JSName('removeEventListener') 18990 @JSName('removeEventListener')
18085 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 18991 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
18992
18993 Stream<Event> get onCueChange => cueChangeEvent.forTarget(this);
18086 } 18994 }
18087 18995
18088 /// @docsEditable true 18996 /// @docsEditable true
18089 class TextTrackEvents extends Events { 18997 class TextTrackEvents extends Events {
18090 /// @docsEditable true 18998 /// @docsEditable true
18091 TextTrackEvents(EventTarget _ptr) : super(_ptr); 18999 TextTrackEvents(EventTarget _ptr) : super(_ptr);
18092 19000
18093 /// @docsEditable true 19001 /// @docsEditable true
18094 EventListenerList get cueChange => this['cuechange']; 19002 EventListenerList get cueChange => this['cuechange'];
18095 } 19003 }
18096 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19004 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
18097 // for details. All rights reserved. Use of this source code is governed by a 19005 // for details. All rights reserved. Use of this source code is governed by a
18098 // BSD-style license that can be found in the LICENSE file. 19006 // BSD-style license that can be found in the LICENSE file.
18099 19007
18100 19008
18101 /// @domName TextTrackCue; @docsEditable true 19009 /// @domName TextTrackCue; @docsEditable true
18102 class TextTrackCue extends EventTarget native "*TextTrackCue" { 19010 class TextTrackCue extends EventTarget native "*TextTrackCue" {
18103 19011
19012 static const EventStreamProvider<Event> enterEvent = const EventStreamProvider <Event>('enter');
19013
19014 static const EventStreamProvider<Event> exitEvent = const EventStreamProvider< Event>('exit');
19015
18104 ///@docsEditable true 19016 ///@docsEditable true
18105 factory TextTrackCue(num startTime, num endTime, String text) => TextTrackCue. _create(startTime, endTime, text); 19017 factory TextTrackCue(num startTime, num endTime, String text) => TextTrackCue. _create(startTime, endTime, text);
18106 static TextTrackCue _create(num startTime, num endTime, String text) => JS('Te xtTrackCue', 'new TextTrackCue(#,#,#)', startTime, endTime, text); 19018 static TextTrackCue _create(num startTime, num endTime, String text) => JS('Te xtTrackCue', 'new TextTrackCue(#,#,#)', startTime, endTime, text);
18107 19019
18108 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 19020 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
18109 TextTrackCueEvents get on => 19021 TextTrackCueEvents get on =>
18110 new TextTrackCueEvents(this); 19022 new TextTrackCueEvents(this);
18111 19023
18112 /// @domName TextTrackCue.align; @docsEditable true 19024 /// @domName TextTrackCue.align; @docsEditable true
18113 String align; 19025 String align;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
18153 @JSName('dispatchEvent') 19065 @JSName('dispatchEvent')
18154 bool $dom_dispatchEvent(Event evt) native; 19066 bool $dom_dispatchEvent(Event evt) native;
18155 19067
18156 /// @domName TextTrackCue.getCueAsHTML; @docsEditable true 19068 /// @domName TextTrackCue.getCueAsHTML; @docsEditable true
18157 @JSName('getCueAsHTML') 19069 @JSName('getCueAsHTML')
18158 DocumentFragment getCueAsHtml() native; 19070 DocumentFragment getCueAsHtml() native;
18159 19071
18160 /// @domName TextTrackCue.removeEventListener; @docsEditable true 19072 /// @domName TextTrackCue.removeEventListener; @docsEditable true
18161 @JSName('removeEventListener') 19073 @JSName('removeEventListener')
18162 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 19074 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
19075
19076 Stream<Event> get onEnter => enterEvent.forTarget(this);
19077
19078 Stream<Event> get onExit => exitEvent.forTarget(this);
18163 } 19079 }
18164 19080
18165 /// @docsEditable true 19081 /// @docsEditable true
18166 class TextTrackCueEvents extends Events { 19082 class TextTrackCueEvents extends Events {
18167 /// @docsEditable true 19083 /// @docsEditable true
18168 TextTrackCueEvents(EventTarget _ptr) : super(_ptr); 19084 TextTrackCueEvents(EventTarget _ptr) : super(_ptr);
18169 19085
18170 /// @docsEditable true 19086 /// @docsEditable true
18171 EventListenerList get enter => this['enter']; 19087 EventListenerList get enter => this['enter'];
18172 19088
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
18336 TextTrackCue item(int index) native; 19252 TextTrackCue item(int index) native;
18337 } 19253 }
18338 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19254 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
18339 // for details. All rights reserved. Use of this source code is governed by a 19255 // for details. All rights reserved. Use of this source code is governed by a
18340 // BSD-style license that can be found in the LICENSE file. 19256 // BSD-style license that can be found in the LICENSE file.
18341 19257
18342 19258
18343 /// @domName TextTrackList; @docsEditable true 19259 /// @domName TextTrackList; @docsEditable true
18344 class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L ist<TextTrack> native "*TextTrackList" { 19260 class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L ist<TextTrack> native "*TextTrackList" {
18345 19261
19262 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack');
19263
18346 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 19264 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
18347 TextTrackListEvents get on => 19265 TextTrackListEvents get on =>
18348 new TextTrackListEvents(this); 19266 new TextTrackListEvents(this);
18349 19267
18350 /// @domName TextTrackList.length; @docsEditable true 19268 /// @domName TextTrackList.length; @docsEditable true
18351 int get length => JS("int", "#.length", this); 19269 int get length => JS("int", "#.length", this);
18352 19270
18353 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index); 19271 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index);
18354 19272
18355 void operator[]=(int index, TextTrack value) { 19273 void operator[]=(int index, TextTrack value) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
18502 /// @domName TextTrackList.dispatchEvent; @docsEditable true 19420 /// @domName TextTrackList.dispatchEvent; @docsEditable true
18503 @JSName('dispatchEvent') 19421 @JSName('dispatchEvent')
18504 bool $dom_dispatchEvent(Event evt) native; 19422 bool $dom_dispatchEvent(Event evt) native;
18505 19423
18506 /// @domName TextTrackList.item; @docsEditable true 19424 /// @domName TextTrackList.item; @docsEditable true
18507 TextTrack item(int index) native; 19425 TextTrack item(int index) native;
18508 19426
18509 /// @domName TextTrackList.removeEventListener; @docsEditable true 19427 /// @domName TextTrackList.removeEventListener; @docsEditable true
18510 @JSName('removeEventListener') 19428 @JSName('removeEventListener')
18511 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 19429 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
19430
19431 Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
18512 } 19432 }
18513 19433
18514 /// @docsEditable true 19434 /// @docsEditable true
18515 class TextTrackListEvents extends Events { 19435 class TextTrackListEvents extends Events {
18516 /// @docsEditable true 19436 /// @docsEditable true
18517 TextTrackListEvents(EventTarget _ptr) : super(_ptr); 19437 TextTrackListEvents(EventTarget _ptr) : super(_ptr);
18518 19438
18519 /// @docsEditable true 19439 /// @docsEditable true
18520 EventListenerList get addTrack => this['addtrack']; 19440 EventListenerList get addTrack => this['addtrack'];
18521 } 19441 }
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
21031 // BSD-style license that can be found in the LICENSE file. 21951 // BSD-style license that can be found in the LICENSE file.
21032 21952
21033 21953
21034 /// @domName WebSocket; @docsEditable true 21954 /// @domName WebSocket; @docsEditable true
21035 @SupportedBrowser(SupportedBrowser.CHROME) 21955 @SupportedBrowser(SupportedBrowser.CHROME)
21036 @SupportedBrowser(SupportedBrowser.FIREFOX) 21956 @SupportedBrowser(SupportedBrowser.FIREFOX)
21037 @SupportedBrowser(SupportedBrowser.IE, '10') 21957 @SupportedBrowser(SupportedBrowser.IE, '10')
21038 @SupportedBrowser(SupportedBrowser.SAFARI) 21958 @SupportedBrowser(SupportedBrowser.SAFARI)
21039 class WebSocket extends EventTarget native "*WebSocket" { 21959 class WebSocket extends EventTarget native "*WebSocket" {
21040 21960
21961 static const EventStreamProvider<CloseEvent> closeEvent = const EventStreamPro vider<CloseEvent>('close');
21962
21963 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
21964
21965 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
21966
21967 static const EventStreamProvider<Event> openEvent = const EventStreamProvider< Event>('open');
21968
21041 ///@docsEditable true 21969 ///@docsEditable true
21042 factory WebSocket(String url) => WebSocket._create(url); 21970 factory WebSocket(String url) => WebSocket._create(url);
21043 static WebSocket _create(String url) => JS('WebSocket', 'new WebSocket(#)', ur l); 21971 static WebSocket _create(String url) => JS('WebSocket', 'new WebSocket(#)', ur l);
21044 21972
21045 /** 21973 /**
21046 * Checks if this type is supported on the current platform 21974 * Checks if this type is supported on the current platform
21047 */ 21975 */
21048 static bool get supported => JS('bool', 'typeof window.WebSocket != "undefined "'); 21976 static bool get supported => JS('bool', 'typeof window.WebSocket != "undefined "');
21049 21977
21050 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 21978 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
21091 /// @domName WebSocket.dispatchEvent; @docsEditable true 22019 /// @domName WebSocket.dispatchEvent; @docsEditable true
21092 @JSName('dispatchEvent') 22020 @JSName('dispatchEvent')
21093 bool $dom_dispatchEvent(Event evt) native; 22021 bool $dom_dispatchEvent(Event evt) native;
21094 22022
21095 /// @domName WebSocket.removeEventListener; @docsEditable true 22023 /// @domName WebSocket.removeEventListener; @docsEditable true
21096 @JSName('removeEventListener') 22024 @JSName('removeEventListener')
21097 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 22025 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
21098 22026
21099 /// @domName WebSocket.send; @docsEditable true 22027 /// @domName WebSocket.send; @docsEditable true
21100 bool send(data) native; 22028 bool send(data) native;
22029
22030 Stream<CloseEvent> get onClose => closeEvent.forTarget(this);
22031
22032 Stream<Event> get onError => errorEvent.forTarget(this);
22033
22034 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
22035
22036 Stream<Event> get onOpen => openEvent.forTarget(this);
21101 } 22037 }
21102 22038
21103 /// @docsEditable true 22039 /// @docsEditable true
21104 class WebSocketEvents extends Events { 22040 class WebSocketEvents extends Events {
21105 /// @docsEditable true 22041 /// @docsEditable true
21106 WebSocketEvents(EventTarget _ptr) : super(_ptr); 22042 WebSocketEvents(EventTarget _ptr) : super(_ptr);
21107 22043
21108 /// @docsEditable true 22044 /// @docsEditable true
21109 EventListenerList get close => this['close']; 22045 EventListenerList get close => this['close'];
21110 22046
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
21360 */ 22296 */
21361 void registerPort(String name, var port) { 22297 void registerPort(String name, var port) {
21362 var serialized = _serialize(port); 22298 var serialized = _serialize(port);
21363 document.documentElement.attributes['dart-port:$name'] = json.stringify(seri alized); 22299 document.documentElement.attributes['dart-port:$name'] = json.stringify(seri alized);
21364 } 22300 }
21365 22301
21366 /// @domName Window.console; @docsEditable true 22302 /// @domName Window.console; @docsEditable true
21367 Console get console => Console.safeConsole; 22303 Console get console => Console.safeConsole;
21368 22304
21369 22305
22306 static const EventStreamProvider<Event> contentLoadedEvent = const EventStream Provider<Event>('DOMContentLoaded');
22307
22308 static const EventStreamProvider<Event> abortEvent = const EventStreamProvider <Event>('abort');
22309
22310 static const EventStreamProvider<Event> beforeUnloadEvent = const EventStreamP rovider<Event>('beforeunload');
22311
22312 static const EventStreamProvider<Event> blurEvent = const EventStreamProvider< Event>('blur');
22313
22314 static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvid er<Event>('canplay');
22315
22316 static const EventStreamProvider<Event> canPlayThroughEvent = const EventStrea mProvider<Event>('canplaythrough');
22317
22318 static const EventStreamProvider<Event> changeEvent = const EventStreamProvide r<Event>('change');
22319
22320 static const EventStreamProvider<MouseEvent> clickEvent = const EventStreamPro vider<MouseEvent>('click');
22321
22322 static const EventStreamProvider<MouseEvent> contextMenuEvent = const EventStr eamProvider<MouseEvent>('contextmenu');
22323
22324 static const EventStreamProvider<Event> doubleClickEvent = const EventStreamPr ovider<Event>('dblclick');
22325
22326 static const EventStreamProvider<DeviceMotionEvent> deviceMotionEvent = const EventStreamProvider<DeviceMotionEvent>('devicemotion');
22327
22328 static const EventStreamProvider<DeviceOrientationEvent> deviceOrientationEven t = const EventStreamProvider<DeviceOrientationEvent>('deviceorientation');
22329
22330 static const EventStreamProvider<MouseEvent> dragEvent = const EventStreamProv ider<MouseEvent>('drag');
22331
22332 static const EventStreamProvider<MouseEvent> dragEndEvent = const EventStreamP rovider<MouseEvent>('dragend');
22333
22334 static const EventStreamProvider<MouseEvent> dragEnterEvent = const EventStrea mProvider<MouseEvent>('dragenter');
22335
22336 static const EventStreamProvider<MouseEvent> dragLeaveEvent = const EventStrea mProvider<MouseEvent>('dragleave');
22337
22338 static const EventStreamProvider<MouseEvent> dragOverEvent = const EventStream Provider<MouseEvent>('dragover');
22339
22340 static const EventStreamProvider<MouseEvent> dragStartEvent = const EventStrea mProvider<MouseEvent>('dragstart');
22341
22342 static const EventStreamProvider<MouseEvent> dropEvent = const EventStreamProv ider<MouseEvent>('drop');
22343
22344 static const EventStreamProvider<Event> durationChangeEvent = const EventStrea mProvider<Event>('durationchange');
22345
22346 static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvid er<Event>('emptied');
22347
22348 static const EventStreamProvider<Event> endedEvent = const EventStreamProvider <Event>('ended');
22349
22350 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
22351
22352 static const EventStreamProvider<Event> focusEvent = const EventStreamProvider <Event>('focus');
22353
22354 static const EventStreamProvider<HashChangeEvent> hashChangeEvent = const Even tStreamProvider<HashChangeEvent>('hashchange');
22355
22356 static const EventStreamProvider<Event> inputEvent = const EventStreamProvider <Event>('input');
22357
22358 static const EventStreamProvider<Event> invalidEvent = const EventStreamProvid er<Event>('invalid');
22359
22360 static const EventStreamProvider<KeyboardEvent> keyDownEvent = const EventStre amProvider<KeyboardEvent>('keydown');
22361
22362 static const EventStreamProvider<KeyboardEvent> keyPressEvent = const EventStr eamProvider<KeyboardEvent>('keypress');
22363
22364 static const EventStreamProvider<KeyboardEvent> keyUpEvent = const EventStream Provider<KeyboardEvent>('keyup');
22365
22366 static const EventStreamProvider<Event> loadEvent = const EventStreamProvider< Event>('load');
22367
22368 static const EventStreamProvider<Event> loadedDataEvent = const EventStreamPro vider<Event>('loadeddata');
22369
22370 static const EventStreamProvider<Event> loadedMetadataEvent = const EventStrea mProvider<Event>('loadedmetadata');
22371
22372 static const EventStreamProvider<Event> loadStartEvent = const EventStreamProv ider<Event>('loadstart');
22373
22374 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
22375
22376 static const EventStreamProvider<MouseEvent> mouseDownEvent = const EventStrea mProvider<MouseEvent>('mousedown');
22377
22378 static const EventStreamProvider<MouseEvent> mouseMoveEvent = const EventStrea mProvider<MouseEvent>('mousemove');
22379
22380 static const EventStreamProvider<MouseEvent> mouseOutEvent = const EventStream Provider<MouseEvent>('mouseout');
22381
22382 static const EventStreamProvider<MouseEvent> mouseOverEvent = const EventStrea mProvider<MouseEvent>('mouseover');
22383
22384 static const EventStreamProvider<MouseEvent> mouseUpEvent = const EventStreamP rovider<MouseEvent>('mouseup');
22385
22386 static const EventStreamProvider<WheelEvent> mouseWheelEvent = const EventStre amProvider<WheelEvent>('mousewheel');
22387
22388 static const EventStreamProvider<Event> offlineEvent = const EventStreamProvid er<Event>('offline');
22389
22390 static const EventStreamProvider<Event> onlineEvent = const EventStreamProvide r<Event>('online');
22391
22392 static const EventStreamProvider<Event> pageHideEvent = const EventStreamProvi der<Event>('pagehide');
22393
22394 static const EventStreamProvider<Event> pageShowEvent = const EventStreamProvi der<Event>('pageshow');
22395
22396 static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider <Event>('pause');
22397
22398 static const EventStreamProvider<Event> playEvent = const EventStreamProvider< Event>('play');
22399
22400 static const EventStreamProvider<Event> playingEvent = const EventStreamProvid er<Event>('playing');
22401
22402 static const EventStreamProvider<PopStateEvent> popStateEvent = const EventStr eamProvider<PopStateEvent>('popstate');
22403
22404 static const EventStreamProvider<Event> progressEvent = const EventStreamProvi der<Event>('progress');
22405
22406 static const EventStreamProvider<Event> rateChangeEvent = const EventStreamPro vider<Event>('ratechange');
22407
22408 static const EventStreamProvider<Event> resetEvent = const EventStreamProvider <Event>('reset');
22409
22410 static const EventStreamProvider<Event> resizeEvent = const EventStreamProvide r<Event>('resize');
22411
22412 static const EventStreamProvider<Event> scrollEvent = const EventStreamProvide r<Event>('scroll');
22413
22414 static const EventStreamProvider<Event> searchEvent = const EventStreamProvide r<Event>('search');
22415
22416 static const EventStreamProvider<Event> seekedEvent = const EventStreamProvide r<Event>('seeked');
22417
22418 static const EventStreamProvider<Event> seekingEvent = const EventStreamProvid er<Event>('seeking');
22419
22420 static const EventStreamProvider<Event> selectEvent = const EventStreamProvide r<Event>('select');
22421
22422 static const EventStreamProvider<Event> stalledEvent = const EventStreamProvid er<Event>('stalled');
22423
22424 static const EventStreamProvider<StorageEvent> storageEvent = const EventStrea mProvider<StorageEvent>('storage');
22425
22426 static const EventStreamProvider<Event> submitEvent = const EventStreamProvide r<Event>('submit');
22427
22428 static const EventStreamProvider<Event> suspendEvent = const EventStreamProvid er<Event>('suspend');
22429
22430 static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamPro vider<Event>('timeupdate');
22431
22432 static const EventStreamProvider<TouchEvent> touchCancelEvent = const EventStr eamProvider<TouchEvent>('touchcancel');
22433
22434 static const EventStreamProvider<TouchEvent> touchEndEvent = const EventStream Provider<TouchEvent>('touchend');
22435
22436 static const EventStreamProvider<TouchEvent> touchMoveEvent = const EventStrea mProvider<TouchEvent>('touchmove');
22437
22438 static const EventStreamProvider<TouchEvent> touchStartEvent = const EventStre amProvider<TouchEvent>('touchstart');
22439
22440 static const EventStreamProvider<Event> unloadEvent = const EventStreamProvide r<Event>('unload');
22441
22442 static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamP rovider<Event>('volumechange');
22443
22444 static const EventStreamProvider<Event> waitingEvent = const EventStreamProvid er<Event>('waiting');
22445
22446 static const EventStreamProvider<AnimationEvent> animationEndEvent = const Eve ntStreamProvider<AnimationEvent>('webkitAnimationEnd');
22447
22448 static const EventStreamProvider<AnimationEvent> animationIterationEvent = con st EventStreamProvider<AnimationEvent>('webkitAnimationIteration');
22449
22450 static const EventStreamProvider<AnimationEvent> animationStartEvent = const E ventStreamProvider<AnimationEvent>('webkitAnimationStart');
22451
22452 static const EventStreamProvider<TransitionEvent> transitionEndEvent = const E ventStreamProvider<TransitionEvent>('webkitTransitionEnd');
22453
21370 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 22454 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
21371 WindowEvents get on => 22455 WindowEvents get on =>
21372 new WindowEvents(this); 22456 new WindowEvents(this);
21373 22457
21374 static const int PERSISTENT = 1; 22458 static const int PERSISTENT = 1;
21375 22459
21376 static const int TEMPORARY = 0; 22460 static const int TEMPORARY = 0;
21377 22461
21378 /// @domName Window.applicationCache; @docsEditable true 22462 /// @domName Window.applicationCache; @docsEditable true
21379 final ApplicationCache applicationCache; 22463 final ApplicationCache applicationCache;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
21642 /// @domName Window.webkitConvertPointFromPageToNode; @docsEditable true 22726 /// @domName Window.webkitConvertPointFromPageToNode; @docsEditable true
21643 Point webkitConvertPointFromPageToNode(Node node, Point p) native; 22727 Point webkitConvertPointFromPageToNode(Node node, Point p) native;
21644 22728
21645 /// @domName DOMWindow.webkitRequestFileSystem; @docsEditable true 22729 /// @domName DOMWindow.webkitRequestFileSystem; @docsEditable true
21646 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal lback, [ErrorCallback errorCallback]) native; 22730 void webkitRequestFileSystem(int type, int size, FileSystemCallback successCal lback, [ErrorCallback errorCallback]) native;
21647 22731
21648 /// @domName DOMWindow.webkitResolveLocalFileSystemURL; @docsEditable true 22732 /// @domName DOMWindow.webkitResolveLocalFileSystemURL; @docsEditable true
21649 @JSName('webkitResolveLocalFileSystemURL') 22733 @JSName('webkitResolveLocalFileSystemURL')
21650 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback , [ErrorCallback errorCallback]) native; 22734 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback , [ErrorCallback errorCallback]) native;
21651 22735
22736 Stream<Event> get onContentLoaded => contentLoadedEvent.forTarget(this);
22737
22738 Stream<Event> get onAbort => abortEvent.forTarget(this);
22739
22740 Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
22741
22742 Stream<Event> get onBlur => blurEvent.forTarget(this);
22743
22744 Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
22745
22746 Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
22747
22748 Stream<Event> get onChange => changeEvent.forTarget(this);
22749
22750 Stream<MouseEvent> get onClick => clickEvent.forTarget(this);
22751
22752 Stream<MouseEvent> get onContextMenu => contextMenuEvent.forTarget(this);
22753
22754 Stream<Event> get onDoubleClick => doubleClickEvent.forTarget(this);
22755
22756 Stream<DeviceMotionEvent> get onDeviceMotion => deviceMotionEvent.forTarget(th is);
22757
22758 Stream<DeviceOrientationEvent> get onDeviceOrientation => deviceOrientationEve nt.forTarget(this);
22759
22760 Stream<MouseEvent> get onDrag => dragEvent.forTarget(this);
22761
22762 Stream<MouseEvent> get onDragEnd => dragEndEvent.forTarget(this);
22763
22764 Stream<MouseEvent> get onDragEnter => dragEnterEvent.forTarget(this);
22765
22766 Stream<MouseEvent> get onDragLeave => dragLeaveEvent.forTarget(this);
22767
22768 Stream<MouseEvent> get onDragOver => dragOverEvent.forTarget(this);
22769
22770 Stream<MouseEvent> get onDragStart => dragStartEvent.forTarget(this);
22771
22772 Stream<MouseEvent> get onDrop => dropEvent.forTarget(this);
22773
22774 Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
22775
22776 Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
22777
22778 Stream<Event> get onEnded => endedEvent.forTarget(this);
22779
22780 Stream<Event> get onError => errorEvent.forTarget(this);
22781
22782 Stream<Event> get onFocus => focusEvent.forTarget(this);
22783
22784 Stream<HashChangeEvent> get onHashChange => hashChangeEvent.forTarget(this);
22785
22786 Stream<Event> get onInput => inputEvent.forTarget(this);
22787
22788 Stream<Event> get onInvalid => invalidEvent.forTarget(this);
22789
22790 Stream<KeyboardEvent> get onKeyDown => keyDownEvent.forTarget(this);
22791
22792 Stream<KeyboardEvent> get onKeyPress => keyPressEvent.forTarget(this);
22793
22794 Stream<KeyboardEvent> get onKeyUp => keyUpEvent.forTarget(this);
22795
22796 Stream<Event> get onLoad => loadEvent.forTarget(this);
22797
22798 Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
22799
22800 Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
22801
22802 Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
22803
22804 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
22805
22806 Stream<MouseEvent> get onMouseDown => mouseDownEvent.forTarget(this);
22807
22808 Stream<MouseEvent> get onMouseMove => mouseMoveEvent.forTarget(this);
22809
22810 Stream<MouseEvent> get onMouseOut => mouseOutEvent.forTarget(this);
22811
22812 Stream<MouseEvent> get onMouseOver => mouseOverEvent.forTarget(this);
22813
22814 Stream<MouseEvent> get onMouseUp => mouseUpEvent.forTarget(this);
22815
22816 Stream<WheelEvent> get onMouseWheel => mouseWheelEvent.forTarget(this);
22817
22818 Stream<Event> get onOffline => offlineEvent.forTarget(this);
22819
22820 Stream<Event> get onOnline => onlineEvent.forTarget(this);
22821
22822 Stream<Event> get onPageHide => pageHideEvent.forTarget(this);
22823
22824 Stream<Event> get onPageShow => pageShowEvent.forTarget(this);
22825
22826 Stream<Event> get onPause => pauseEvent.forTarget(this);
22827
22828 Stream<Event> get onPlay => playEvent.forTarget(this);
22829
22830 Stream<Event> get onPlaying => playingEvent.forTarget(this);
22831
22832 Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
22833
22834 Stream<Event> get onProgress => progressEvent.forTarget(this);
22835
22836 Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
22837
22838 Stream<Event> get onReset => resetEvent.forTarget(this);
22839
22840 Stream<Event> get onResize => resizeEvent.forTarget(this);
22841
22842 Stream<Event> get onScroll => scrollEvent.forTarget(this);
22843
22844 Stream<Event> get onSearch => searchEvent.forTarget(this);
22845
22846 Stream<Event> get onSeeked => seekedEvent.forTarget(this);
22847
22848 Stream<Event> get onSeeking => seekingEvent.forTarget(this);
22849
22850 Stream<Event> get onSelect => selectEvent.forTarget(this);
22851
22852 Stream<Event> get onStalled => stalledEvent.forTarget(this);
22853
22854 Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
22855
22856 Stream<Event> get onSubmit => submitEvent.forTarget(this);
22857
22858 Stream<Event> get onSuspend => suspendEvent.forTarget(this);
22859
22860 Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
22861
22862 Stream<TouchEvent> get onTouchCancel => touchCancelEvent.forTarget(this);
22863
22864 Stream<TouchEvent> get onTouchEnd => touchEndEvent.forTarget(this);
22865
22866 Stream<TouchEvent> get onTouchMove => touchMoveEvent.forTarget(this);
22867
22868 Stream<TouchEvent> get onTouchStart => touchStartEvent.forTarget(this);
22869
22870 Stream<Event> get onUnload => unloadEvent.forTarget(this);
22871
22872 Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
22873
22874 Stream<Event> get onWaiting => waitingEvent.forTarget(this);
22875
22876 Stream<AnimationEvent> get onAnimationEnd => animationEndEvent.forTarget(this) ;
22877
22878 Stream<AnimationEvent> get onAnimationIteration => animationIterationEvent.for Target(this);
22879
22880 Stream<AnimationEvent> get onAnimationStart => animationStartEvent.forTarget(t his);
22881
22882 Stream<TransitionEvent> get onTransitionEnd => transitionEndEvent.forTarget(th is);
22883
21652 } 22884 }
21653 22885
21654 /// @docsEditable true 22886 /// @docsEditable true
21655 class WindowEvents extends Events { 22887 class WindowEvents extends Events {
21656 /// @docsEditable true 22888 /// @docsEditable true
21657 WindowEvents(EventTarget _ptr) : super(_ptr); 22889 WindowEvents(EventTarget _ptr) : super(_ptr);
21658 22890
21659 /// @docsEditable true 22891 /// @docsEditable true
21660 EventListenerList get contentLoaded => this['DOMContentLoaded']; 22892 EventListenerList get contentLoaded => this['DOMContentLoaded'];
21661 22893
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
21879 EventListenerList get transitionEnd => this['webkitTransitionEnd']; 23111 EventListenerList get transitionEnd => this['webkitTransitionEnd'];
21880 } 23112 }
21881 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 23113 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21882 // for details. All rights reserved. Use of this source code is governed by a 23114 // for details. All rights reserved. Use of this source code is governed by a
21883 // BSD-style license that can be found in the LICENSE file. 23115 // BSD-style license that can be found in the LICENSE file.
21884 23116
21885 23117
21886 /// @domName Worker; @docsEditable true 23118 /// @domName Worker; @docsEditable true
21887 class Worker extends AbstractWorker native "*Worker" { 23119 class Worker extends AbstractWorker native "*Worker" {
21888 23120
23121 static const EventStreamProvider<MessageEvent> messageEvent = const EventStrea mProvider<MessageEvent>('message');
23122
21889 ///@docsEditable true 23123 ///@docsEditable true
21890 factory Worker(String scriptUrl) => Worker._create(scriptUrl); 23124 factory Worker(String scriptUrl) => Worker._create(scriptUrl);
21891 static Worker _create(String scriptUrl) => JS('Worker', 'new Worker(#)', scrip tUrl); 23125 static Worker _create(String scriptUrl) => JS('Worker', 'new Worker(#)', scrip tUrl);
21892 23126
21893 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 23127 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
21894 WorkerEvents get on => 23128 WorkerEvents get on =>
21895 new WorkerEvents(this); 23129 new WorkerEvents(this);
21896 23130
21897 /// @domName Worker.postMessage; @docsEditable true 23131 /// @domName Worker.postMessage; @docsEditable true
21898 void postMessage(/*SerializedScriptValue*/ message, [List messagePorts]) { 23132 void postMessage(/*SerializedScriptValue*/ message, [List messagePorts]) {
21899 if (?messagePorts) { 23133 if (?messagePorts) {
21900 var message_1 = convertDartToNative_SerializedScriptValue(message); 23134 var message_1 = convertDartToNative_SerializedScriptValue(message);
21901 _postMessage_1(message_1, messagePorts); 23135 _postMessage_1(message_1, messagePorts);
21902 return; 23136 return;
21903 } 23137 }
21904 var message_2 = convertDartToNative_SerializedScriptValue(message); 23138 var message_2 = convertDartToNative_SerializedScriptValue(message);
21905 _postMessage_2(message_2); 23139 _postMessage_2(message_2);
21906 return; 23140 return;
21907 } 23141 }
21908 @JSName('postMessage') 23142 @JSName('postMessage')
21909 void _postMessage_1(message, List messagePorts) native; 23143 void _postMessage_1(message, List messagePorts) native;
21910 @JSName('postMessage') 23144 @JSName('postMessage')
21911 void _postMessage_2(message) native; 23145 void _postMessage_2(message) native;
21912 23146
21913 /// @domName Worker.terminate; @docsEditable true 23147 /// @domName Worker.terminate; @docsEditable true
21914 void terminate() native; 23148 void terminate() native;
23149
23150 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
21915 } 23151 }
21916 23152
21917 /// @docsEditable true 23153 /// @docsEditable true
21918 class WorkerEvents extends AbstractWorkerEvents { 23154 class WorkerEvents extends AbstractWorkerEvents {
21919 /// @docsEditable true 23155 /// @docsEditable true
21920 WorkerEvents(EventTarget _ptr) : super(_ptr); 23156 WorkerEvents(EventTarget _ptr) : super(_ptr);
21921 23157
21922 /// @docsEditable true 23158 /// @docsEditable true
21923 EventListenerList get message => this['message']; 23159 EventListenerList get message => this['message'];
21924 } 23160 }
21925 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 23161 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21926 // for details. All rights reserved. Use of this source code is governed by a 23162 // for details. All rights reserved. Use of this source code is governed by a
21927 // BSD-style license that can be found in the LICENSE file. 23163 // BSD-style license that can be found in the LICENSE file.
21928 23164
21929 23165
21930 /// @domName WorkerContext 23166 /// @domName WorkerContext
21931 class WorkerContext extends EventTarget native "*WorkerContext" { 23167 class WorkerContext extends EventTarget native "*WorkerContext" {
21932 23168
23169 static const EventStreamProvider<Event> errorEvent = const EventStreamProvider <Event>('error');
23170
21933 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 23171 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
21934 WorkerContextEvents get on => 23172 WorkerContextEvents get on =>
21935 new WorkerContextEvents(this); 23173 new WorkerContextEvents(this);
21936 23174
21937 static const int PERSISTENT = 1; 23175 static const int PERSISTENT = 1;
21938 23176
21939 static const int TEMPORARY = 0; 23177 static const int TEMPORARY = 0;
21940 23178
21941 /// @domName WorkerContext.location; @docsEditable true 23179 /// @domName WorkerContext.location; @docsEditable true
21942 final WorkerLocation location; 23180 final WorkerLocation location;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
21993 FileSystemSync webkitRequestFileSystemSync(int type, int size) native; 23231 FileSystemSync webkitRequestFileSystemSync(int type, int size) native;
21994 23232
21995 /// @domName WorkerContext.webkitResolveLocalFileSystemSyncURL; @docsEditable true 23233 /// @domName WorkerContext.webkitResolveLocalFileSystemSyncURL; @docsEditable true
21996 @JSName('webkitResolveLocalFileSystemSyncURL') 23234 @JSName('webkitResolveLocalFileSystemSyncURL')
21997 EntrySync webkitResolveLocalFileSystemSyncUrl(String url) native; 23235 EntrySync webkitResolveLocalFileSystemSyncUrl(String url) native;
21998 23236
21999 /// @domName WorkerContext.webkitResolveLocalFileSystemURL; @docsEditable true 23237 /// @domName WorkerContext.webkitResolveLocalFileSystemURL; @docsEditable true
22000 @JSName('webkitResolveLocalFileSystemURL') 23238 @JSName('webkitResolveLocalFileSystemURL')
22001 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback , [ErrorCallback errorCallback]) native; 23239 void webkitResolveLocalFileSystemUrl(String url, EntryCallback successCallback , [ErrorCallback errorCallback]) native;
22002 23240
23241 Stream<Event> get onError => errorEvent.forTarget(this);
23242
22003 23243
22004 /** 23244 /**
22005 * Gets an instance of the Indexed DB factory to being using Indexed DB. 23245 * Gets an instance of the Indexed DB factory to being using Indexed DB.
22006 * 23246 *
22007 * Use [IdbFactory.supported] to check if Indexed DB is supported on the 23247 * Use [IdbFactory.supported] to check if Indexed DB is supported on the
22008 * current platform. 23248 * current platform.
22009 */ 23249 */
22010 @SupportedBrowser(SupportedBrowser.CHROME, '23.0') 23250 @SupportedBrowser(SupportedBrowser.CHROME, '23.0')
22011 @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0') 23251 @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')
22012 @SupportedBrowser(SupportedBrowser.IE, '10.0') 23252 @SupportedBrowser(SupportedBrowser.IE, '10.0')
(...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after
24363 * Determines if the current device is running WebKit. 25603 * Determines if the current device is running WebKit.
24364 */ 25604 */
24365 static bool get isWebKit => !isOpera && userAgent.contains("WebKit", 0); 25605 static bool get isWebKit => !isOpera && userAgent.contains("WebKit", 0);
24366 } 25606 }
24367 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 25607 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
24368 // for details. All rights reserved. Use of this source code is governed by a 25608 // for details. All rights reserved. Use of this source code is governed by a
24369 // BSD-style license that can be found in the LICENSE file. 25609 // BSD-style license that can be found in the LICENSE file.
24370 25610
24371 25611
24372 typedef void EventListener(Event event); 25612 typedef void EventListener(Event event);
25613 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
25614 // for details. All rights reserved. Use of this source code is governed by a
25615 // BSD-style license that can be found in the LICENSE file.
25616
25617
25618 /**
25619 * Adapter for exposing DOM events as Dart streams.
25620 */
25621 class _EventStream<T extends Event> extends Stream<T> {
25622 final EventTarget _target;
25623 final String _eventType;
25624 final bool _useCapture;
25625
25626 _EventStream(this._target, this._eventType, this._useCapture);
25627
25628 // DOM events are inherently multi-subscribers.
25629 Stream<T> asMultiSubscriberStream() => this;
25630
25631 StreamSubscription<T> listen(void onData(T event),
25632 { void onError(AsyncError error),
25633 void onDone(),
25634 bool unsubscribeOnError}) {
25635
25636 return new _EventStreamSubscription<T>(
25637 this._target, this._eventType, onData, this._useCapture);
25638 }
25639 }
25640
25641 class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
25642 int _pauseCount = 0;
25643 EventTarget _target;
25644 final String _eventType;
25645 var _onData;
25646 final bool _useCapture;
25647
25648 _EventStreamSubscription(this._target, this._eventType, this._onData,
25649 this._useCapture) {
25650 _tryResume();
25651 }
25652
25653 void cancel() {
25654 if (_canceled) {
25655 throw new StateError("Subscription has been canceled.");
25656 }
25657
25658 _unlisten();
25659 // Clear out the target to indicate this is complete.
25660 _target = null;
25661 _onData = null;
25662 }
25663
25664 bool get _canceled => _target == null;
25665
25666 void onData(void handleData(T event)) {
25667 if (_canceled) {
25668 throw new StateError("Subscription has been canceled.");
25669 }
25670 // Remove current event listener.
25671 _unlisten();
25672
25673 _onData = handleData;
25674 _tryResume();
25675 }
25676
25677 /// Has no effect.
25678 void onError(void handleError(AsyncError error)) {}
25679
25680 /// Has no effect.
25681 void onDone(void handleDone()) {}
25682
25683 void pause([Future resumeSignal]) {
25684 if (_canceled) {
25685 throw new StateError("Subscription has been canceled.");
25686 }
25687 ++_pauseCount;
25688 _unlisten();
25689
25690 if (resumeSignal != null) {
25691 resumeSignal.whenComplete(resume);
25692 }
25693 }
25694
25695 bool get _paused => _pauseCount > 0;
25696
25697 void resume() {
25698 if (_canceled) {
25699 throw new StateError("Subscription has been canceled.");
25700 }
25701 if (!_paused) {
25702 throw new StateError("Subscription is not paused.");
25703 }
25704 --_pauseCount;
25705 _tryResume();
25706 }
25707
25708 void _tryResume() {
25709 if (_onData != null && !_paused) {
25710 _target.$dom_addEventListener(_eventType, _onData, _useCapture);
25711 }
25712 }
25713
25714 void _unlisten() {
25715 if (_onData != null) {
25716 _target.$dom_removeEventListener(_eventType, _onData, _useCapture);
25717 }
25718 }
25719 }
25720
25721
25722 /**
25723 * A factory to expose DOM events as Streams.
25724 */
25725 class EventStreamProvider<T extends Event> {
25726 final String _eventType;
25727
25728 const EventStreamProvider(this._eventType);
25729
25730 /**
25731 * Gets a [Stream] for this event type, on the specified target.
25732 *
25733 * This may be used to capture DOM events:
25734 *
25735 * Element.keyDownEvent.forTarget(element, useCapture: true).listen(...);
25736 *
25737 * Or for listening to an event which will bubble through the DOM tree:
25738 *
25739 * MediaElement.pauseEvent.forTarget(document.body).listen(...);
25740 *
25741 * See also:
25742 *
25743 * [addEventListener](http://docs.webplatform.org/wiki/dom/methods/addEventLis tener)
25744 */
25745 Stream<T> forTarget(EventTarget e, {bool useCapture: false}) {
25746 return new _EventStream(e, _eventType, useCapture);
25747 }
25748 }
24373 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 25749 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24374 // for details. All rights reserved. Use of this source code is governed by a 25750 // for details. All rights reserved. Use of this source code is governed by a
24375 // BSD-style license that can be found in the LICENSE file. 25751 // BSD-style license that can be found in the LICENSE file.
24376 25752
24377 25753
24378 /** 25754 /**
24379 * Works with KeyboardEvent and KeyEvent to determine how to expose information 25755 * Works with KeyboardEvent and KeyEvent to determine how to expose information
24380 * about Key(board)Events. This class functions like an EventListenerList, and 25756 * about Key(board)Events. This class functions like an EventListenerList, and
24381 * provides a consistent interface for the Dart 25757 * provides a consistent interface for the Dart
24382 * user, despite the fact that a multitude of browsers that have varying 25758 * user, despite the fact that a multitude of browsers that have varying
(...skipping 2515 matching lines...) Expand 10 before | Expand all | Expand 10 after
26898 _position = nextPosition; 28274 _position = nextPosition;
26899 return true; 28275 return true;
26900 } 28276 }
26901 _current = null; 28277 _current = null;
26902 _position = _array.length; 28278 _position = _array.length;
26903 return false; 28279 return false;
26904 } 28280 }
26905 28281
26906 T get current => _current; 28282 T get current => _current;
26907 } 28283 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698