-
-
Notifications
You must be signed in to change notification settings - Fork 64
/
window.dart
1247 lines (1009 loc) · 42.4 KB
/
window.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2019 [email protected]
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*
Some source code in this file was adopted from 'dart:html' in Dart SDK. See:
https://github.com/dart-lang/sdk/tree/master/tools/dom
The source code adopted from 'dart:html' had the following license:
Copyright 2012, the Dart project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
part of universal_html.internal;
/// Global window.
Window get window => WindowController.topLevel.window as Window;
abstract class LocationBase {
set href(String val);
}
class Window extends EventTarget
with WindowBase
implements WindowEventHandlers {
/// Static factory designed to expose `contentloaded` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> contentLoadedEvent =
EventStreamProvider<Event>('DOMContentLoaded');
/// Static factory designed to expose `devicemotion` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<DeviceMotionEvent> deviceMotionEvent =
EventStreamProvider<DeviceMotionEvent>('devicemotion');
/// Static factory designed to expose `deviceorientation` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<DeviceOrientationEvent>
deviceOrientationEvent =
EventStreamProvider<DeviceOrientationEvent>('deviceorientation');
/// Static factory designed to expose `hashchange` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> hashChangeEvent =
EventStreamProvider<Event>('hashchange');
static const EventStreamProvider<Event> loadStartEvent =
EventStreamProvider<Event>('loadstart');
/// Static factory designed to expose `message` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<MessageEvent> messageEvent =
EventStreamProvider<MessageEvent>('message');
/// Static factory designed to expose `offline` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> offlineEvent =
EventStreamProvider<Event>('offline');
/// Static factory designed to expose `online` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> onlineEvent =
EventStreamProvider<Event>('online');
/// Static factory designed to expose `pagehide` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> pageHideEvent =
EventStreamProvider<Event>('pagehide');
/// Static factory designed to expose `pageshow` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> pageShowEvent =
EventStreamProvider<Event>('pageshow');
/// Static factory designed to expose `popstate` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<PopStateEvent> popStateEvent =
EventStreamProvider<PopStateEvent>('popstate');
static const EventStreamProvider<Event> progressEvent =
EventStreamProvider<Event>('progress');
/// Static factory designed to expose `storage` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<StorageEvent> storageEvent =
EventStreamProvider<StorageEvent>('storage');
/// Static factory designed to expose `unload` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<Event> unloadEvent =
EventStreamProvider<Event>('unload');
/// Static factory designed to expose `animationend` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<AnimationEvent> animationEndEvent =
EventStreamProvider<AnimationEvent>('webkitAnimationEnd');
/// Static factory designed to expose `animationiteration` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<AnimationEvent> animationIterationEvent =
EventStreamProvider<AnimationEvent>('webkitAnimationIteration');
/// Static factory designed to expose `animationstart` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<AnimationEvent> animationStartEvent =
EventStreamProvider<AnimationEvent>('webkitAnimationStart');
/// Indicates that file system data cannot be cleared unless given user
/// permission.
///
/// ## Other resources
///
/// * [Exploring the FileSystem
/// APIs](http://www.html5rocks.com/en/tutorials/file/filesystem/)
/// from HTML5Rocks.
/// * [File API](http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem)
/// from W3C.
static const int PERSISTENT = 1;
/// Indicates that file system data can be cleared at any time.
///
/// ## Other resources
///
/// * [Exploring the FileSystem
/// APIs](http://www.html5rocks.com/en/tutorials/file/filesystem/) from HTML5Rocks.
/// * [File API](http://www.w3.org/TR/file-system-api/#idl-def-LocalFileSystem)
/// from W3C.
static const int TEMPORARY = 0;
// API level getter and setter for Location.
// TODO: The cross domain safe wrapper can be inserted here.
/// Static factory designed to expose `beforeunload` events to event
/// handlers that are not necessarily instances of [Window].
///
/// See [EventStreamProvider] for usage information.
static const EventStreamProvider<BeforeUnloadEvent> beforeUnloadEvent =
EventStreamProvider('beforeunload');
/// convertPointFromNodeToPage and convertPointFromPageToNode are removed.
/// see http://dev.w3.org/csswg/cssom-view/#geometry
static bool get supportsPointConversions => false;
/// The application cache for this window.
///
/// ## Other resources
///
/// * [A beginner's guide to using the application
/// cache](http://www.html5rocks.com/en/tutorials/appcache/beginner)
/// from HTML5Rocks.
/// * [Application cache
/// API](https://html.spec.whatwg.org/multipage/browsers.html#application-cache-api)
/// from WHATWG.
late final ApplicationCache? applicationCache = ApplicationCache.internal();
late final CacheStorage? caches = CacheStorage._();
late final CookieStore? cookieStore = CookieStore._();
/// *Deprecated*.
String? defaultStatus;
/// *Deprecated*.
String? defaultstatus;
late final External? external = External.internal();
/// The current session history for this window's newest document.
///
/// ## Other resources
///
/// * [Loading web pages](https://html.spec.whatwg.org/multipage/browsers.html)
/// from WHATWG.
@override
late final History history = History.internal();
/// Storage for this window that persists across sessions.
///
/// ## Other resources
///
/// * [DOM storage guide](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage)
/// from MDN.
/// * [The past, present & future of local storage for web
/// applications](http://diveintohtml5.info/storage.html) from Dive Into HTML5.
/// * [Local storage specification](http://www.w3.org/TR/webstorage/#the-localstorage-attribute)
/// from W3C.
late final Storage localStorage = Storage._(this);
/// The name of this window.
///
/// ## Other resources
///
/// * [Window.name](https://developer.mozilla.org/en-US/docs/Web/API/Window/name)
/// from MDN.
String? name;
/// The user agent accessing this window.
///
/// ## Other resources
///
/// * [The navigator
/// object](https://html.spec.whatwg.org/multipage/webappapis.html#the-navigator-object)
/// from WHATWG.
late final Navigator navigator = () {
// Note that `as` expressions are required because of
// "dart:html OR universal_html" confusion by the analyzer.
final window = this as universal_html_in_browser_or_vm.Window;
final navigator =
internalWindowController.windowBehavior.newNavigator(window: window);
return navigator as Navigator;
}();
@override
WindowBase? opener;
/// The height of this window including all user interface elements.
///
/// ## Other resources
///
/// * [Window.outerHeight](https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight)
/// from MDN.
final int outerHeight;
/// The width of the window including all user interface elements.
///
/// ## Other resources
///
/// * [Window.outerWidth](https://developer.mozilla.org/en-US/docs/Web/API/Window/outerWidth)
/// from MDN.
final int outerWidth;
/// Timing and navigation data for this window.
///
/// ## Other resources
///
/// * [Measuring page load speed with navigation
/// timeing](http://www.html5rocks.com/en/tutorials/webperformance/basics/)
/// from HTML5Rocks.
/// * [Navigation timing
/// specification](http://www.w3.org/TR/navigation-timing/) from W3C.
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.FIREFOX)
@SupportedBrowser(SupportedBrowser.IE)
late final Performance performance = Performance._();
/// Storage for this window that is cleared when this session ends.
///
/// ## Other resources
///
/// * [DOM storage
/// guide](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage)
/// from MDN.
/// * [The past, present & future of local storage for web
/// applications](http://diveintohtml5.info/storage.html) from Dive Into HTML5.
/// * [Local storage
/// specification](http://www.w3.org/TR/webstorage/#dom-sessionstorage) from W3C.
late final Storage sessionStorage = Storage._(this);
/// *Deprecated*.
String? status;
final WindowController internalWindowController;
final String _initialHref;
/// The debugging console for this window.
late final Console console = Console.internal();
/// The newest document in this window.
///
/// ## Other resources
///
/// * [Loading web
/// pages](https://html.spec.whatwg.org/multipage/browsers.html)
/// from WHATWG.
late final Document document = () {
// Note that `as` expressions are required because of
// "dart:html OR universal_html" confusion by the analyzer.
final window = this as universal_html_in_browser_or_vm.Window;
final document =
internalWindowController.windowBehavior.newDocument(window: window);
return document as Document;
}();
/// The current location of this window.
///
/// Location currentLocation = window.location;
/// print(currentLocation.href); // 'http://www.example.com:80/'
@override
late Location location = Location.internal(href: _initialHref);
@protected
Selection? internalSelection;
/// Information about the screen displaying this window.
///
/// ## Other resources
///
/// * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
/// from W3C.
late final Screen? screen = Screen.constructor();
/// An internal constructor that's NOT part of "dart:html".
///
/// This API is not for public use.
/// We may do backwards-incompatible changes.
Window.internal({
required this.internalWindowController,
required String href,
this.outerWidth = 0,
this.outerHeight = 0,
}) : _initialHref = href,
super.internal();
/// Returns a Future that completes just before the window is about to
/// repaint so the user can draw an animation frame.
///
/// If you need to later cancel this animation, use [requestAnimationFrame]
/// instead.
///
/// The [Future] completes to a timestamp that represents a floating
/// point value of the number of milliseconds that have elapsed since the page
/// started to load (which is also the timestamp at this call to
/// animationFrame).
///
/// Note: The code that runs when the future completes should call
/// [animationFrame] again for the animation to continue.
Future<num> get animationFrame {
final completer = Completer<num>.sync();
requestAnimationFrame((num value) {
completer.complete(value);
});
return completer.future;
}
Worklet? get animationWorklet => null;
Worklet? get audioWorklet => null;
@override
bool? get closed => null;
/// Entrypoint for the browser's cryptographic functions.
///
/// ## Other resources
///
/// * [Web cryptography API](http://www.w3.org/TR/WebCryptoAPI/) from W3C.
Crypto? get crypto => null;
CustomElementRegistry? get customElements => null;
/// The ratio between physical pixels and logical CSS pixels.
///
/// ## Other resources
///
/// * [devicePixelRatio](http://www.quirksmode.org/blog/archives/2012/06/devicepixelrati.html)
/// from quirksmode.
/// * [More about devicePixelRatio](http://www.quirksmode.org/blog/archives/2012/07/more_about_devi.html)
/// from quirksmode.
num get devicePixelRatio => 1;
/// Gets an instance of the Indexed DB factory to being using Indexed DB.
///
/// Use [indexed_db.IdbFactory.supported] to check if Indexed DB is supported on the
/// current platform.
IdbFactory? get indexedDB => null;
/// The height of the viewport including scrollbars.
///
/// ## Other resources
///
/// * [Window.innerHeight](https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight)
/// from MDN.
int? get innerHeight => null;
/// The width of the viewport including scrollbars.
///
/// ## Other resources
///
/// * [Window.innerWidth](https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth)
/// from MDN.
int? get innerWidth => null;
bool? get isSecureContext => false;
/// This window's location bar, which displays the URL.
///
/// ## Other resources
///
/// * [Browser interface
/// elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
/// from WHATWG.
BarProp? get locationbar => null;
/// This window's menu bar, which displays menu commands.
///
/// ## Other resources
///
/// * [Browser interface
/// elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
/// from WHATWG.
BarProp? get menubar => null;
/// Whether objects are drawn offscreen before being displayed.
///
/// ## Other resources
///
/// * [offscreenBuffering](https://webplatform.github.io/docs/dom/HTMLElement/offscreenBuffering/)
/// from WebPlatform.org.
bool? get offscreenBuffering => false;
/// Stream of `abort` events handled by this [Window].
Stream<Event> get onAbort => Element.abortEvent.forTarget(this);
/// Stream of `animationend` events handled by this [Window].
Stream<AnimationEvent> get onAnimationEnd =>
animationEndEvent.forTarget(this);
/// Stream of `animationiteration` events handled by this [Window].
Stream<AnimationEvent> get onAnimationIteration =>
animationIterationEvent.forTarget(this);
/// Stream of `animationstart` events handled by this [Window].
Stream<AnimationEvent> get onAnimationStart =>
animationStartEvent.forTarget(this);
/// Stream of `beforeunload` events handled by this [Window].
Stream<Event> get onBeforeUnload => beforeUnloadEvent.forTarget(this);
/// Stream of `blur` events handled by this [Window].
Stream<Event> get onBlur => Element.blurEvent.forTarget(this);
Stream<Event> get onCanPlay => Element.canPlayEvent.forTarget(this);
Stream<Event> get onCanPlayThrough =>
Element.canPlayThroughEvent.forTarget(this);
/// Stream of `change` events handled by this [Window].
Stream<Event> get onChange => Element.changeEvent.forTarget(this);
/// Stream of `click` events handled by this [Window].
Stream<MouseEvent> get onClick => Element.clickEvent.forTarget(this);
/// Stream of `contentloaded` events handled by this [Window].
Stream<Event> get onContentLoaded => contentLoadedEvent.forTarget(this);
/// Stream of `contextmenu` events handled by this [Window].
Stream<MouseEvent> get onContextMenu =>
Element.contextMenuEvent.forTarget(this);
/// Stream of `devicemotion` events handled by this [Window].
Stream<DeviceMotionEvent> get onDeviceMotion =>
deviceMotionEvent.forTarget(this);
/// Stream of `deviceorientation` events handled by this [Window].
Stream<DeviceOrientationEvent> get onDeviceOrientation =>
deviceOrientationEvent.forTarget(this);
/// Stream of `doubleclick` events handled by this [Window].
@DomName('Window.ondblclick')
Stream<Event> get onDoubleClick => Element.doubleClickEvent.forTarget(this);
/// Stream of `drag` events handled by this [Window].
Stream<MouseEvent> get onDrag => Element.dragEvent.forTarget(this);
/// Stream of `dragend` events handled by this [Window].
Stream<MouseEvent> get onDragEnd => Element.dragEndEvent.forTarget(this);
/// Stream of `dragenter` events handled by this [Window].
Stream<MouseEvent> get onDragEnter => Element.dragEnterEvent.forTarget(this);
/// Stream of `dragleave` events handled by this [Window].
Stream<MouseEvent> get onDragLeave => Element.dragLeaveEvent.forTarget(this);
/// Stream of `dragover` events handled by this [Window].
Stream<MouseEvent> get onDragOver => Element.dragOverEvent.forTarget(this);
/// Stream of `dragstart` events handled by this [Window].
Stream<MouseEvent> get onDragStart => Element.dragStartEvent.forTarget(this);
/// Stream of `drop` events handled by this [Window].
Stream<MouseEvent> get onDrop => Element.dropEvent.forTarget(this);
Stream<Event> get onDurationChange =>
Element.durationChangeEvent.forTarget(this);
Stream<Event> get onEmptied => Element.emptiedEvent.forTarget(this);
Stream<Event> get onEnded => Element.endedEvent.forTarget(this);
/// Stream of `error` events handled by this [Window].
Stream<Event> get onError => Element.errorEvent.forTarget(this);
/// Stream of `focus` events handled by this [Window].
Stream<Event> get onFocus => Element.focusEvent.forTarget(this);
/// Stream of `hashchange` events handled by this [Window].
@override
Stream<Event> get onHashChange => hashChangeEvent.forTarget(this);
// From WindowBase64
/// Stream of `input` events handled by this [Window].
Stream<Event> get onInput => Element.inputEvent.forTarget(this);
/// Stream of `invalid` events handled by this [Window].
Stream<Event> get onInvalid => Element.invalidEvent.forTarget(this);
/// Stream of `keydown` events handled by this [Window].
Stream<KeyboardEvent> get onKeyDown => Element.keyDownEvent.forTarget(this);
/// Stream of `keypress` events handled by this [Window].
Stream<KeyboardEvent> get onKeyPress => Element.keyPressEvent.forTarget(this);
/// Stream of `keyup` events handled by this [Window].
Stream<KeyboardEvent> get onKeyUp => Element.keyUpEvent.forTarget(this);
/// Stream of `load` events handled by this [Window].
Stream<Event> get onLoad => Element.loadEvent.forTarget(this);
Stream<Event> get onLoadedData => Element.loadedDataEvent.forTarget(this);
Stream<Event> get onLoadedMetadata =>
Element.loadedMetadataEvent.forTarget(this);
Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
/// Stream of `message` events handled by this [Window].
@override
Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
/// Stream of `mousedown` events handled by this [Window].
Stream<MouseEvent> get onMouseDown => Element.mouseDownEvent.forTarget(this);
/// Stream of `mouseenter` events handled by this [Window].
Stream<MouseEvent> get onMouseEnter =>
Element.mouseEnterEvent.forTarget(this);
/// Stream of `mouseleave` events handled by this [Window].
Stream<MouseEvent> get onMouseLeave =>
Element.mouseLeaveEvent.forTarget(this);
/// Stream of `mousemove` events handled by this [Window].
Stream<MouseEvent> get onMouseMove => Element.mouseMoveEvent.forTarget(this);
/// Stream of `mouseout` events handled by this [Window].
Stream<MouseEvent> get onMouseOut => Element.mouseOutEvent.forTarget(this);
/// Stream of `mouseover` events handled by this [Window].
Stream<MouseEvent> get onMouseOver => Element.mouseOverEvent.forTarget(this);
/// Stream of `mouseup` events handled by this [Window].
Stream<MouseEvent> get onMouseUp => Element.mouseUpEvent.forTarget(this);
/// Stream of `mousewheel` events handled by this [Window].
Stream<WheelEvent> get onMouseWheel =>
Element.mouseWheelEvent.forTarget(this);
/// Stream of `offline` events handled by this [Window].
@override
Stream<Event> get onOffline => offlineEvent.forTarget(this);
/// Stream of `online` events handled by this [Window].
@override
Stream<Event> get onOnline => onlineEvent.forTarget(this);
/// Stream of `pagehide` events handled by this [Window].
Stream<Event> get onPageHide => pageHideEvent.forTarget(this);
/// Stream of `pageshow` events handled by this [Window].
Stream<Event> get onPageShow => pageShowEvent.forTarget(this);
Stream<Event> get onPause => Element.pauseEvent.forTarget(this);
Stream<Event> get onPlay => Element.playEvent.forTarget(this);
Stream<Event> get onPlaying => Element.playingEvent.forTarget(this);
/// Stream of `popstate` events handled by this [Window].
@override
Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
Stream<Event> get onProgress => progressEvent.forTarget(this);
Stream<Event> get onRateChange => Element.rateChangeEvent.forTarget(this);
/// Stream of `reset` events handled by this [Window].
Stream<Event> get onReset => Element.resetEvent.forTarget(this);
/// Stream of `resize` events handled by this [Window].
Stream<Event> get onResize => Element.resizeEvent.forTarget(this);
/// Stream of `scroll` events handled by this [Window].
Stream<Event> get onScroll => Element.scrollEvent.forTarget(this);
/// Stream of `search` events handled by this [Window].
Stream<Event> get onSearch => Element.searchEvent.forTarget(this);
Stream<Event> get onSeeked => Element.seekedEvent.forTarget(this);
Stream<Event> get onSeeking => Element.seekingEvent.forTarget(this);
/// Stream of `select` events handled by this [Window].
Stream<Event> get onSelect => Element.selectEvent.forTarget(this);
Stream<Event> get onStalled => Element.stalledEvent.forTarget(this);
/// Stream of `storage` events handled by this [Window].
@override
Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
/// Stream of `submit` events handled by this [Window].
Stream<Event> get onSubmit => Element.submitEvent.forTarget(this);
Stream<Event> get onSuspend => Element.suspendEvent.forTarget(this);
Stream<Event> get onTimeUpdate => Element.timeUpdateEvent.forTarget(this);
/// Stream of `touchcancel` events handled by this [Window].
Stream<TouchEvent> get onTouchCancel =>
Element.touchCancelEvent.forTarget(this);
/// Stream of `touchend` events handled by this [Window].
Stream<TouchEvent> get onTouchEnd => Element.touchEndEvent.forTarget(this);
/// Stream of `touchmove` events handled by this [Window].
Stream<TouchEvent> get onTouchMove => Element.touchMoveEvent.forTarget(this);
/// Stream of `touchstart` events handled by this [Window].
Stream<TouchEvent> get onTouchStart =>
Element.touchStartEvent.forTarget(this);
/// Stream of `transitionend` events handled by this [Window].
Stream<TransitionEvent> get onTransitionEnd =>
Element.transitionEndEvent.forTarget(this);
/// Stream of `unload` events handled by this [Window].
@override
Stream<Event> get onUnload => unloadEvent.forTarget(this);
Stream<Event> get onVolumeChange => Element.volumeChangeEvent.forTarget(this);
Stream<Event> get onWaiting => Element.waitingEvent.forTarget(this);
/// Stream of `wheel` events handled by this [Window].
Stream<WheelEvent> get onWheel => Element.wheelEvent.forTarget(this);
int? get orientation => 0;
String? get origin => null;
int get pageXOffset => 0;
int get pageYOffset => 0;
// From WindowBase64
@override
WindowBase? get parent => null;
/// The distance from the left side of the screen to the left side of this
/// window.
///
/// ## Other resources
///
/// * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
/// from W3C.
int? get screenLeft => null;
/// The distance from the top of the screen to the top of this window.
///
/// ## Other resources
///
/// * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
/// from W3C.
int? get screenTop => null;
/// The distance from the left side of the screen to the mouse pointer.
///
/// ## Other resources
///
/// * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
/// from W3C.
int? get screenX => null;
/// The distance from the top of the screen to the mouse pointer.
///
/// ## Other resources
///
/// * [The Screen interface specification](http://www.w3.org/TR/cssom-view/#screen)
/// from W3C.
int? get screenY => null;
/// This window's scroll bars.
///
/// ## Other resources
///
/// * [Browser interface
/// elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
/// from WHATWG.
BarProp? get scrollbars => null;
/// The distance this window has been scrolled horizontally.
///
/// ## Other resources
///
/// * [The Screen interface
/// specification](http://www.w3.org/TR/cssom-view/#screen) from W3C.
/// * [scrollX](https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollX)
/// from MDN.
int get scrollX => document.documentElement!.scrollLeft;
/// The distance this window has been scrolled vertically.
///
/// ## Other resources
///
/// * [The Screen interface
/// specification](http://www.w3.org/TR/cssom-view/#screen) from W3C.
/// * [scrollY](https://developer.mozilla.org/en-US/docs/Web/API/Window.scrollY)
/// from MDN.
int get scrollY => document.documentElement!.scrollTop;
/// The current window.
///
/// ## Other resources
///
/// * [Window.self](https://developer.mozilla.org/en-US/docs/Web/API/Window.self)
/// from MDN.
WindowBase? get self {
throw UnimplementedError();
}
/// Access to speech synthesis in the browser.
///
/// ## Other resources
///
/// * [Web speech
/// specification](https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section)
/// from W3C.
SpeechSynthesis? get speechSynthesis => null;
/// This window's status bar.
///
/// ## Other resources
///
/// * [Browser interface
/// elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
/// from WHATWG.
BarProp? get statusbar => null;
/// Access to CSS media queries.
///
/// ## Other resources
///
/// * [StyleMedia class
/// reference](https://developer.apple.com/library/safari/documentation/SafariDOMAdditions/Reference/StyleMedia/)
/// from Safari Developer Library.
StyleMedia? get styleMedia => null;
/// This window's tool bar.
///
/// ## Other resources
///
/// * [Browser interface
/// elements](https://html.spec.whatwg.org/multipage/browsers.html#browser-interface-elements)
/// from WHATWG.
BarProp? get toolbar => null;
@override
WindowBase? get top => null;
VisualViewport? get visualViewport => null;
/// The current window.
///
/// ## Other resources
///
/// * [Window.window](https://developer.mozilla.org/en-US/docs/Web/API/Window.window)
/// from MDN.
WindowBase? get window => null;
/// Displays a modal alert to the user.
///
/// ## Other resources
///
/// * [User prompts](https://html.spec.whatwg.org/multipage/webappapis.html#user-prompts)
/// from WHATWG.
void alert([String? message]) {
throw UnimplementedError();
}
String atob(String atob) => throw UnimplementedError();
String btoa(String btoa) => throw UnimplementedError();
void cancelIdleCallback(int handle) {
throw UnimplementedError();
}
@override
void close() {
throw UnimplementedError();
}
/// Displays a modal OK/Cancel prompt to the user.
///
/// ## Other resources
///
/// * [User prompts](https://html.spec.whatwg.org/multipage/webappapis.html#user-prompts)
/// from WHATWG.
bool confirm([String? message]) {
throw UnimplementedError();
}
Future fetch(/*RequestInfo*/ input, [Map? init]) {
throw UnimplementedError();
}
/// Finds text in this window.
///
/// ## Other resources
///
/// * [Window.find](https://developer.mozilla.org/en-US/docs/Web/API/Window.find)
/// from MDN.
bool find(String? string, bool? caseSensitive, bool? backwards, bool? wrap,
bool? wholeWord, bool? searchInFrames, bool? showDialog) {
throw UnimplementedError();
}
StylePropertyMapReadonly getComputedStyleMap(
Element element, String? pseudoElement) {
throw UnimplementedError();
}
@JSName('getMatchedCSSRules')
/// Returns all CSS rules that apply to the element's pseudo-element.
List<CssRule> getMatchedCssRules(Element? element, String? pseudoElement) {
throw UnimplementedError();
}
/// Returns the currently selected text.
///
/// ## Other resources
///
/// * [Window.getSelection](https://developer.mozilla.org/en-US/docs/Web/API/Window.getSelection)
/// from MDN.
Selection? getSelection() => internalSelection;
/// Returns a list of media queries for the given query string.
///
/// ## Other resources
///
/// * [Testing media
/// queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Testing_media_queries)
/// from MDN.
/// * [The MediaQueryList
/// specification](http://www.w3.org/TR/cssom-view/#the-mediaquerylist-interface) from W3C.
MediaQueryList matchMedia(String query) {
throw UnimplementedError();
}
/// Moves this window.
///
/// x and y can be negative.
///
/// ## Other resources
///
/// * [Window.moveBy](https://developer.mozilla.org/en-US/docs/Web/API/Window.moveBy)
/// from MDN.
/// * [Window.moveBy](http://dev.w3.org/csswg/cssom-view/#dom-window-moveby) from W3C.
void moveBy(int x, int y) {}
/// Moves this window to a specific position.
///
/// x and y can be negative.
///
/// ## Other resources
///
/// * [Window.moveTo](https://developer.mozilla.org/en-US/docs/Web/API/Window.moveTo)
/// from MDN.
/// * [Window.moveTo](http://dev.w3.org/csswg/cssom-view/#dom-window-moveto)
/// from W3C.
void moveTo(Point p) {}
/// Opens a new window.
///
/// ## Other resources
///
/// * [Window.open](https://developer.mozilla.org/en-US/docs/Web/API/Window.open)
/// from MDN.
WindowBase? open(String url, String name, [String? options]) {
return null;
}
@override
void postMessage(/*any*/ message, String targetOrigin,
[List<Object>? messagePorts]) {
throw UnimplementedError();
}
/// Opens the print dialog for this window.
///
/// ## Other resources
///
/// * [Window.print](https://developer.mozilla.org/en-US/docs/Web/API/Window.print)
/// from MDN.
void print() {}
/// Called to draw an animation frame and then request the window to repaint
/// after [callback] has finished (creating the animation).
///
/// Use this method only if you need to later call [cancelAnimationFrame]. If
/// not, the preferred Dart idiom is to set animation frames by calling
/// [animationFrame], which returns a Future.
///
/// Returns a non-zero valued integer to represent the request id for this