-
Notifications
You must be signed in to change notification settings - Fork 6
/
dom.dart
1753 lines (1363 loc) · 56.2 KB
/
dom.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
/// DOM Standard
///
/// https://dom.spec.whatwg.org/
// ignore_for_file: unused_import
@JS('window')
@staticInterop
library dom;
import 'dart:js_util' as js_util;
import 'package:js/js.dart';
import 'package:js_bindings/js_bindings.dart';
@JS()
@staticInterop
class Event {
external Event(String type, [EventInit? eventInitDict]);
@JS('NONE')
external static int get none;
@JS('CAPTURING_PHASE')
external static int get capturingPhase;
@JS('AT_TARGET')
external static int get atTarget;
@JS('BUBBLING_PHASE')
external static int get bubblingPhase;
}
extension PropsEvent on Event {
String get type => js_util.getProperty(this, 'type');
EventTarget? get target => js_util.getProperty(this, 'target');
EventTarget? get srcElement => js_util.getProperty(this, 'srcElement');
EventTarget? get currentTarget => js_util.getProperty(this, 'currentTarget');
Iterable<EventTarget> composedPath() =>
js_util.callMethod(this, 'composedPath', []);
int get eventPhase => js_util.getProperty(this, 'eventPhase');
Object stopPropagation() => js_util.callMethod(this, 'stopPropagation', []);
bool get cancelBubble => js_util.getProperty(this, 'cancelBubble');
set cancelBubble(bool newValue) {
js_util.setProperty(this, 'cancelBubble', newValue);
}
Object stopImmediatePropagation() =>
js_util.callMethod(this, 'stopImmediatePropagation', []);
bool get bubbles => js_util.getProperty(this, 'bubbles');
bool get cancelable => js_util.getProperty(this, 'cancelable');
dynamic get returnValue => js_util.getProperty(this, 'returnValue');
set returnValue(dynamic newValue) {
js_util.setProperty(this, 'returnValue', newValue);
}
Object preventDefault() => js_util.callMethod(this, 'preventDefault', []);
bool get defaultPrevented => js_util.getProperty(this, 'defaultPrevented');
bool get composed => js_util.getProperty(this, 'composed');
bool get isTrusted => js_util.getProperty(this, 'isTrusted');
double get timeStamp => js_util.getProperty(this, 'timeStamp');
Object initEvent(String type,
[bool? bubbles = false, bool? cancelable = false]) =>
js_util.callMethod(this, 'initEvent', [type, bubbles, cancelable]);
}
@anonymous
@JS()
@staticInterop
class EventInit {
external factory EventInit(
{bool? bubbles = false,
bool? cancelable = false,
bool? composed = false});
}
extension PropsEventInit on EventInit {
bool get bubbles => js_util.getProperty(this, 'bubbles');
set bubbles(bool newValue) {
js_util.setProperty(this, 'bubbles', newValue);
}
bool get cancelable => js_util.getProperty(this, 'cancelable');
set cancelable(bool newValue) {
js_util.setProperty(this, 'cancelable', newValue);
}
bool get composed => js_util.getProperty(this, 'composed');
set composed(bool newValue) {
js_util.setProperty(this, 'composed', newValue);
}
}
@JS()
@staticInterop
class CustomEvent implements Event {
external CustomEvent(String type, [CustomEventInit? eventInitDict]);
}
extension PropsCustomEvent on CustomEvent {
dynamic get detail => js_util.getProperty(this, 'detail');
Object initCustomEvent(String type,
[bool? bubbles = false, bool? cancelable = false, dynamic detail]) =>
js_util.callMethod(
this, 'initCustomEvent', [type, bubbles, cancelable, detail]);
}
@anonymous
@JS()
@staticInterop
class CustomEventInit implements EventInit {
external factory CustomEventInit({dynamic detail});
}
extension PropsCustomEventInit on CustomEventInit {
dynamic get detail => js_util.getProperty(this, 'detail');
set detail(dynamic newValue) {
js_util.setProperty(this, 'detail', newValue);
}
}
@JS()
@staticInterop
class EventTarget {
external EventTarget();
}
extension PropsEventTarget on EventTarget {
Object addEventListener(String type, EventListener? callback,
[dynamic options]) =>
js_util.callMethod(this, 'addEventListener',
[type, callback == null ? null : allowInterop(callback), options]);
Object removeEventListener(String type, EventListener? callback,
[dynamic options]) =>
js_util.callMethod(this, 'removeEventListener',
[type, callback == null ? null : allowInterop(callback), options]);
bool dispatchEvent(Event event) =>
js_util.callMethod(this, 'dispatchEvent', [event]);
}
@anonymous
@JS()
@staticInterop
class EventListenerOptions {
external factory EventListenerOptions({bool? capture = false});
}
extension PropsEventListenerOptions on EventListenerOptions {
bool get capture => js_util.getProperty(this, 'capture');
set capture(bool newValue) {
js_util.setProperty(this, 'capture', newValue);
}
}
@anonymous
@JS()
@staticInterop
class AddEventListenerOptions implements EventListenerOptions {
external factory AddEventListenerOptions(
{bool? passive = false, bool? once = false, AbortSignal? signal});
}
extension PropsAddEventListenerOptions on AddEventListenerOptions {
bool get passive => js_util.getProperty(this, 'passive');
set passive(bool newValue) {
js_util.setProperty(this, 'passive', newValue);
}
bool get once => js_util.getProperty(this, 'once');
set once(bool newValue) {
js_util.setProperty(this, 'once', newValue);
}
AbortSignal get signal => js_util.getProperty(this, 'signal');
set signal(AbortSignal newValue) {
js_util.setProperty(this, 'signal', newValue);
}
}
@JS()
@staticInterop
class AbortController {
external AbortController();
}
extension PropsAbortController on AbortController {
AbortSignal get signal => js_util.getProperty(this, 'signal');
Object abort([dynamic reason]) => js_util.callMethod(this, 'abort', [reason]);
}
@JS()
@staticInterop
class AbortSignal implements EventTarget {
external AbortSignal();
}
extension PropsAbortSignal on AbortSignal {
static AbortSignal abort([dynamic reason]) =>
js_util.callMethod(AbortSignal, 'abort', [reason]);
static AbortSignal timeout(int milliseconds) =>
js_util.callMethod(AbortSignal, 'timeout', [milliseconds]);
bool get aborted => js_util.getProperty(this, 'aborted');
dynamic get reason => js_util.getProperty(this, 'reason');
Object throwIfAborted() => js_util.callMethod(this, 'throwIfAborted', []);
EventHandlerNonNull? get onabort => js_util.getProperty(this, 'onabort');
set onabort(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onabort', newValue);
}
}
@JS()
@staticInterop
class NonElementParentNode {
external NonElementParentNode();
}
extension PropsNonElementParentNode on NonElementParentNode {
Element? getElementById(String elementId) =>
js_util.callMethod(this, 'getElementById', [elementId]);
}
@JS()
@staticInterop
class DocumentOrShadowRoot {
external DocumentOrShadowRoot();
}
extension PropsDocumentOrShadowRoot on DocumentOrShadowRoot {
Iterable<Animation> getAnimations() =>
js_util.callMethod(this, 'getAnimations', []);
Element? get pointerLockElement =>
js_util.getProperty(this, 'pointerLockElement');
Element? get fullscreenElement =>
js_util.getProperty(this, 'fullscreenElement');
Element? get pictureInPictureElement =>
js_util.getProperty(this, 'pictureInPictureElement');
Element? get activeElement => js_util.getProperty(this, 'activeElement');
StyleSheetList get styleSheets => js_util.getProperty(this, 'styleSheets');
Iterable<CSSStyleSheet> get adoptedStyleSheets =>
js_util.getProperty(this, 'adoptedStyleSheets');
set adoptedStyleSheets(Iterable<CSSStyleSheet> newValue) {
js_util.setProperty(this, 'adoptedStyleSheets', newValue);
}
}
@JS()
@staticInterop
class ParentNode {
external ParentNode();
}
extension PropsParentNode on ParentNode {
HTMLCollection get children => js_util.getProperty(this, 'children');
Element? get firstElementChild =>
js_util.getProperty(this, 'firstElementChild');
Element? get lastElementChild =>
js_util.getProperty(this, 'lastElementChild');
int get childElementCount => js_util.getProperty(this, 'childElementCount');
Object prepend([dynamic nodes1, dynamic nodes2, dynamic nodes3]) =>
js_util.callMethod(this, 'prepend', [nodes1, nodes2, nodes3]);
Object append([dynamic nodes1, dynamic nodes2, dynamic nodes3]) =>
js_util.callMethod(this, 'append', [nodes1, nodes2, nodes3]);
Object replaceChildren([dynamic nodes1, dynamic nodes2, dynamic nodes3]) =>
js_util.callMethod(this, 'replaceChildren', [nodes1, nodes2, nodes3]);
Element? querySelector(String selectors) =>
js_util.callMethod(this, 'querySelector', [selectors]);
NodeList querySelectorAll(String selectors) =>
js_util.callMethod(this, 'querySelectorAll', [selectors]);
}
@JS()
@staticInterop
class NonDocumentTypeChildNode {
external NonDocumentTypeChildNode();
}
extension PropsNonDocumentTypeChildNode on NonDocumentTypeChildNode {
Element? get previousElementSibling =>
js_util.getProperty(this, 'previousElementSibling');
Element? get nextElementSibling =>
js_util.getProperty(this, 'nextElementSibling');
}
@JS()
@staticInterop
class ChildNode {
external ChildNode();
}
extension PropsChildNode on ChildNode {
Object before([dynamic nodes1, dynamic nodes2, dynamic nodes3]) =>
js_util.callMethod(this, 'before', [nodes1, nodes2, nodes3]);
Object after([dynamic nodes1, dynamic nodes2, dynamic nodes3]) =>
js_util.callMethod(this, 'after', [nodes1, nodes2, nodes3]);
Object replaceWith([dynamic nodes1, dynamic nodes2, dynamic nodes3]) =>
js_util.callMethod(this, 'replaceWith', [nodes1, nodes2, nodes3]);
Object remove() => js_util.callMethod(this, 'remove', []);
}
@JS()
@staticInterop
class Slottable {
external Slottable();
}
extension PropsSlottable on Slottable {
HTMLSlotElement? get assignedSlot =>
js_util.getProperty(this, 'assignedSlot');
}
@JS()
@staticInterop
class NodeList extends JsArray<Node> {
external NodeList();
}
extension PropsNodeList on NodeList {
Node? item(int index) => js_util.callMethod(this, 'item', [index]);
int get length => js_util.getProperty(this, 'length');
}
@JS()
@staticInterop
class HTMLCollection {
external HTMLCollection();
}
extension PropsHTMLCollection on HTMLCollection {
int get length => js_util.getProperty(this, 'length');
Element? item(int index) => js_util.callMethod(this, 'item', [index]);
dynamic namedItem(String name) =>
js_util.callMethod(this, 'namedItem', [name]);
}
@JS()
@staticInterop
class MutationObserver {
external MutationObserver(MutationCallback callback);
}
extension PropsMutationObserver on MutationObserver {
Object observe(Node target, [MutationObserverInit? options]) =>
js_util.callMethod(this, 'observe', [target, options]);
Object disconnect() => js_util.callMethod(this, 'disconnect', []);
Iterable<MutationRecord> takeRecords() =>
js_util.callMethod(this, 'takeRecords', []);
}
@anonymous
@JS()
@staticInterop
class MutationObserverInit {
external factory MutationObserverInit(
{bool? childList = false,
bool? attributes,
bool? characterData,
bool? subtree = false,
bool? attributeOldValue,
bool? characterDataOldValue,
Iterable<String>? attributeFilter});
}
extension PropsMutationObserverInit on MutationObserverInit {
bool get childList => js_util.getProperty(this, 'childList');
set childList(bool newValue) {
js_util.setProperty(this, 'childList', newValue);
}
bool get attributes => js_util.getProperty(this, 'attributes');
set attributes(bool newValue) {
js_util.setProperty(this, 'attributes', newValue);
}
bool get characterData => js_util.getProperty(this, 'characterData');
set characterData(bool newValue) {
js_util.setProperty(this, 'characterData', newValue);
}
bool get subtree => js_util.getProperty(this, 'subtree');
set subtree(bool newValue) {
js_util.setProperty(this, 'subtree', newValue);
}
bool get attributeOldValue => js_util.getProperty(this, 'attributeOldValue');
set attributeOldValue(bool newValue) {
js_util.setProperty(this, 'attributeOldValue', newValue);
}
bool get characterDataOldValue =>
js_util.getProperty(this, 'characterDataOldValue');
set characterDataOldValue(bool newValue) {
js_util.setProperty(this, 'characterDataOldValue', newValue);
}
Iterable<String> get attributeFilter =>
js_util.getProperty(this, 'attributeFilter');
set attributeFilter(Iterable<String> newValue) {
js_util.setProperty(this, 'attributeFilter', newValue);
}
}
@JS()
@staticInterop
class MutationRecord {
external MutationRecord();
}
extension PropsMutationRecord on MutationRecord {
String get type => js_util.getProperty(this, 'type');
Node get target => js_util.getProperty(this, 'target');
NodeList get addedNodes => js_util.getProperty(this, 'addedNodes');
NodeList get removedNodes => js_util.getProperty(this, 'removedNodes');
Node? get previousSibling => js_util.getProperty(this, 'previousSibling');
Node? get nextSibling => js_util.getProperty(this, 'nextSibling');
String? get attributeName => js_util.getProperty(this, 'attributeName');
String? get attributeNamespace =>
js_util.getProperty(this, 'attributeNamespace');
String? get oldValue => js_util.getProperty(this, 'oldValue');
}
@JS()
@staticInterop
class Node implements EventTarget {
@JS('ELEMENT_NODE')
external static int get elementNode;
@JS('ATTRIBUTE_NODE')
external static int get attributeNode;
@JS('TEXT_NODE')
external static int get textNode;
@JS('CDATA_SECTION_NODE')
external static int get cdataSectionNode;
@JS('ENTITY_REFERENCE_NODE')
external static int get entityReferenceNode;
@JS('ENTITY_NODE')
external static int get entityNode;
@JS('PROCESSING_INSTRUCTION_NODE')
external static int get processingInstructionNode;
@JS('COMMENT_NODE')
external static int get commentNode;
@JS('DOCUMENT_NODE')
external static int get documentNode;
@JS('DOCUMENT_TYPE_NODE')
external static int get documentTypeNode;
@JS('DOCUMENT_FRAGMENT_NODE')
external static int get documentFragmentNode;
@JS('NOTATION_NODE')
external static int get notationNode;
@JS('DOCUMENT_POSITION_DISCONNECTED')
external static int get documentPositionDisconnected;
@JS('DOCUMENT_POSITION_PRECEDING')
external static int get documentPositionPreceding;
@JS('DOCUMENT_POSITION_FOLLOWING')
external static int get documentPositionFollowing;
@JS('DOCUMENT_POSITION_CONTAINS')
external static int get documentPositionContains;
@JS('DOCUMENT_POSITION_CONTAINED_BY')
external static int get documentPositionContainedBy;
@JS('DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC')
external static int get documentPositionImplementationSpecific;
external Node();
}
extension PropsNode on Node {
int get nodeType => js_util.getProperty(this, 'nodeType');
String get nodeName => js_util.getProperty(this, 'nodeName');
String get baseURI => js_util.getProperty(this, 'baseURI');
bool get isConnected => js_util.getProperty(this, 'isConnected');
Document? get ownerDocument => js_util.getProperty(this, 'ownerDocument');
Node getRootNode([GetRootNodeOptions? options]) =>
js_util.callMethod(this, 'getRootNode', [options]);
Node? get parentNode => js_util.getProperty(this, 'parentNode');
Element? get parentElement => js_util.getProperty(this, 'parentElement');
bool hasChildNodes() => js_util.callMethod(this, 'hasChildNodes', []);
NodeList get childNodes => js_util.getProperty(this, 'childNodes');
Node? get firstChild => js_util.getProperty(this, 'firstChild');
Node? get lastChild => js_util.getProperty(this, 'lastChild');
Node? get previousSibling => js_util.getProperty(this, 'previousSibling');
Node? get nextSibling => js_util.getProperty(this, 'nextSibling');
String? get nodeValue => js_util.getProperty(this, 'nodeValue');
set nodeValue(String? newValue) {
js_util.setProperty(this, 'nodeValue', newValue);
}
String? get textContent => js_util.getProperty(this, 'textContent');
set textContent(String? newValue) {
js_util.setProperty(this, 'textContent', newValue);
}
Object normalize() => js_util.callMethod(this, 'normalize', []);
Node cloneNode([bool? deep = false]) =>
js_util.callMethod(this, 'cloneNode', [deep]);
bool isEqualNode(Node? otherNode) =>
js_util.callMethod(this, 'isEqualNode', [otherNode]);
bool isSameNode(Node? otherNode) =>
js_util.callMethod(this, 'isSameNode', [otherNode]);
int compareDocumentPosition(Node other) =>
js_util.callMethod(this, 'compareDocumentPosition', [other]);
bool contains(Node? other) => js_util.callMethod(this, 'contains', [other]);
String? lookupPrefix(String? namespace) =>
js_util.callMethod(this, 'lookupPrefix', [namespace]);
String? lookupNamespaceURI(String? prefix) =>
js_util.callMethod(this, 'lookupNamespaceURI', [prefix]);
bool isDefaultNamespace(String? namespace) =>
js_util.callMethod(this, 'isDefaultNamespace', [namespace]);
Node insertBefore(Node node, Node? child) =>
js_util.callMethod(this, 'insertBefore', [node, child]);
Node appendChild(Node node) =>
js_util.callMethod(this, 'appendChild', [node]);
Node replaceChild(Node node, Node child) =>
js_util.callMethod(this, 'replaceChild', [node, child]);
Node removeChild(Node child) =>
js_util.callMethod(this, 'removeChild', [child]);
}
@anonymous
@JS()
@staticInterop
class GetRootNodeOptions {
external factory GetRootNodeOptions({bool? composed = false});
}
extension PropsGetRootNodeOptions on GetRootNodeOptions {
bool get composed => js_util.getProperty(this, 'composed');
set composed(bool newValue) {
js_util.setProperty(this, 'composed', newValue);
}
}
@JS()
@staticInterop
class Document
implements
Node,
GeometryUtils,
FontFaceSource,
NonElementParentNode,
DocumentOrShadowRoot,
ParentNode,
XPathEvaluatorBase,
GlobalEventHandlers,
DocumentAndElementEventHandlers {
external Document();
}
extension PropsDocument on Document {
DOMImplementation get implementation =>
js_util.getProperty(this, 'implementation');
String get url => js_util.getProperty(this, 'URL');
String get documentURI => js_util.getProperty(this, 'documentURI');
String get compatMode => js_util.getProperty(this, 'compatMode');
String get characterSet => js_util.getProperty(this, 'characterSet');
String get charset => js_util.getProperty(this, 'charset');
String get inputEncoding => js_util.getProperty(this, 'inputEncoding');
String get contentType => js_util.getProperty(this, 'contentType');
DocumentType? get doctype => js_util.getProperty(this, 'doctype');
Element? get documentElement => js_util.getProperty(this, 'documentElement');
HTMLCollection getElementsByTagName(String qualifiedName) =>
js_util.callMethod(this, 'getElementsByTagName', [qualifiedName]);
HTMLCollection getElementsByTagNameNS(String? namespace, String localName) =>
js_util
.callMethod(this, 'getElementsByTagNameNS', [namespace, localName]);
HTMLCollection getElementsByClassName(String classNames) =>
js_util.callMethod(this, 'getElementsByClassName', [classNames]);
Element createElement(String localName, [dynamic options]) =>
js_util.callMethod(this, 'createElement', [localName, options]);
Element createElementNS(String? namespace, String qualifiedName,
[dynamic options]) =>
js_util.callMethod(
this, 'createElementNS', [namespace, qualifiedName, options]);
DocumentFragment createDocumentFragment() =>
js_util.callMethod(this, 'createDocumentFragment', []);
Text createTextNode(String data) =>
js_util.callMethod(this, 'createTextNode', [data]);
CDATASection createCDATASection(String data) =>
js_util.callMethod(this, 'createCDATASection', [data]);
Comment createComment(String data) =>
js_util.callMethod(this, 'createComment', [data]);
ProcessingInstruction createProcessingInstruction(
String target, String data) =>
js_util.callMethod(this, 'createProcessingInstruction', [target, data]);
Node importNode(Node node, [bool? deep = false]) =>
js_util.callMethod(this, 'importNode', [node, deep]);
Node adoptNode(Node node) => js_util.callMethod(this, 'adoptNode', [node]);
Attr createAttribute(String localName) =>
js_util.callMethod(this, 'createAttribute', [localName]);
Attr createAttributeNS(String? namespace, String qualifiedName) =>
js_util.callMethod(this, 'createAttributeNS', [namespace, qualifiedName]);
Event createEvent(String mInterface) =>
js_util.callMethod(this, 'createEvent', [mInterface]);
Range createRange() => js_util.callMethod(this, 'createRange', []);
NodeIterator createNodeIterator(Node root,
[int? whatToShow = 0xFFFFFFFF, NodeFilter? filter]) =>
js_util
.callMethod(this, 'createNodeIterator', [root, whatToShow, filter]);
TreeWalker createTreeWalker(Node root,
[int? whatToShow = 0xFFFFFFFF, NodeFilter? filter]) =>
js_util.callMethod(this, 'createTreeWalker', [root, whatToShow, filter]);
SVGSVGElement? get rootElement => js_util.getProperty(this, 'rootElement');
Future<bool> hasStorageAccess() =>
js_util.promiseToFuture(js_util.callMethod(this, 'hasStorageAccess', []));
Future<Object> requestStorageAccess() => js_util
.promiseToFuture(js_util.callMethod(this, 'requestStorageAccess', []));
Selection? getSelection() => js_util.callMethod(this, 'getSelection', []);
DocumentTimeline get timeline => js_util.getProperty(this, 'timeline');
Element? elementFromPoint(double x, double y) =>
js_util.callMethod(this, 'elementFromPoint', [x, y]);
Iterable<Element> elementsFromPoint(double x, double y) =>
js_util.callMethod(this, 'elementsFromPoint', [x, y]);
CaretPosition? caretPositionFromPoint(double x, double y) =>
js_util.callMethod(this, 'caretPositionFromPoint', [x, y]);
Element? get scrollingElement =>
js_util.getProperty(this, 'scrollingElement');
EventHandlerNonNull? get onpointerlockchange =>
js_util.getProperty(this, 'onpointerlockchange');
set onpointerlockchange(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onpointerlockchange', newValue);
}
EventHandlerNonNull? get onpointerlockerror =>
js_util.getProperty(this, 'onpointerlockerror');
set onpointerlockerror(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onpointerlockerror', newValue);
}
Object exitPointerLock() => js_util.callMethod(this, 'exitPointerLock', []);
bool get fullscreenEnabled => js_util.getProperty(this, 'fullscreenEnabled');
bool get fullscreen => js_util.getProperty(this, 'fullscreen');
Future<Object> exitFullscreen() =>
js_util.promiseToFuture(js_util.callMethod(this, 'exitFullscreen', []));
EventHandlerNonNull? get onfullscreenchange =>
js_util.getProperty(this, 'onfullscreenchange');
set onfullscreenchange(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onfullscreenchange', newValue);
}
EventHandlerNonNull? get onfullscreenerror =>
js_util.getProperty(this, 'onfullscreenerror');
set onfullscreenerror(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onfullscreenerror', newValue);
}
bool get pictureInPictureEnabled =>
js_util.getProperty(this, 'pictureInPictureEnabled');
Future<Object> exitPictureInPicture() => js_util
.promiseToFuture(js_util.callMethod(this, 'exitPictureInPicture', []));
EventHandlerNonNull? get onfreeze => js_util.getProperty(this, 'onfreeze');
set onfreeze(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onfreeze', newValue);
}
EventHandlerNonNull? get onresume => js_util.getProperty(this, 'onresume');
set onresume(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onresume', newValue);
}
bool get wasDiscarded => js_util.getProperty(this, 'wasDiscarded');
NamedFlowMap get namedFlows => js_util.getProperty(this, 'namedFlows');
FragmentDirective get fragmentDirective =>
js_util.getProperty(this, 'fragmentDirective');
Future<InterestCohort> interestCohort() =>
js_util.promiseToFuture(js_util.callMethod(this, 'interestCohort', []));
PermissionsPolicy get permissionsPolicy =>
js_util.getProperty(this, 'permissionsPolicy');
Location? get location => js_util.getProperty(this, 'location');
String get domain => js_util.getProperty(this, 'domain');
set domain(String newValue) {
js_util.setProperty(this, 'domain', newValue);
}
String get referrer => js_util.getProperty(this, 'referrer');
String get cookie => js_util.getProperty(this, 'cookie');
set cookie(String newValue) {
js_util.setProperty(this, 'cookie', newValue);
}
String get lastModified => js_util.getProperty(this, 'lastModified');
DocumentReadyState get readyState =>
DocumentReadyState.values.byName(js_util.getProperty(this, 'readyState'));
String get title => js_util.getProperty(this, 'title');
set title(String newValue) {
js_util.setProperty(this, 'title', newValue);
}
String get dir => js_util.getProperty(this, 'dir');
set dir(String newValue) {
js_util.setProperty(this, 'dir', newValue);
}
HTMLElement? get body => js_util.getProperty(this, 'body');
set body(HTMLElement? newValue) {
js_util.setProperty(this, 'body', newValue);
}
HTMLHeadElement? get head => js_util.getProperty(this, 'head');
HTMLCollection get images => js_util.getProperty(this, 'images');
HTMLCollection get embeds => js_util.getProperty(this, 'embeds');
HTMLCollection get plugins => js_util.getProperty(this, 'plugins');
HTMLCollection get links => js_util.getProperty(this, 'links');
HTMLCollection get forms => js_util.getProperty(this, 'forms');
HTMLCollection get scripts => js_util.getProperty(this, 'scripts');
NodeList getElementsByName(String elementName) =>
js_util.callMethod(this, 'getElementsByName', [elementName]);
dynamic get currentScript => js_util.getProperty(this, 'currentScript');
Window? open(String url, [String? name, String? features]) =>
js_util.callMethod(this, 'open', [url, name, features]);
Object close() => js_util.callMethod(this, 'close', []);
Object write([String? text1, String? text2, String? text3]) =>
js_util.callMethod(this, 'write', [text1, text2, text3]);
Object writeln([String? text1, String? text2, String? text3]) =>
js_util.callMethod(this, 'writeln', [text1, text2, text3]);
Window? get defaultView => js_util.getProperty(this, 'defaultView');
bool hasFocus() => js_util.callMethod(this, 'hasFocus', []);
String get designMode => js_util.getProperty(this, 'designMode');
set designMode(String newValue) {
js_util.setProperty(this, 'designMode', newValue);
}
bool execCommand(String commandId,
[bool? showUI = false, String? value = '']) =>
js_util.callMethod(this, 'execCommand', [commandId, showUI, value]);
bool queryCommandEnabled(String commandId) =>
js_util.callMethod(this, 'queryCommandEnabled', [commandId]);
bool queryCommandIndeterm(String commandId) =>
js_util.callMethod(this, 'queryCommandIndeterm', [commandId]);
bool queryCommandState(String commandId) =>
js_util.callMethod(this, 'queryCommandState', [commandId]);
bool queryCommandSupported(String commandId) =>
js_util.callMethod(this, 'queryCommandSupported', [commandId]);
String queryCommandValue(String commandId) =>
js_util.callMethod(this, 'queryCommandValue', [commandId]);
bool get hidden => js_util.getProperty(this, 'hidden');
DocumentVisibilityState get visibilityState => DocumentVisibilityState.values
.byName(js_util.getProperty(this, 'visibilityState'));
EventHandlerNonNull? get onreadystatechange =>
js_util.getProperty(this, 'onreadystatechange');
set onreadystatechange(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onreadystatechange', newValue);
}
EventHandlerNonNull? get onvisibilitychange =>
js_util.getProperty(this, 'onvisibilitychange');
set onvisibilitychange(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onvisibilitychange', newValue);
}
String get fgColor => js_util.getProperty(this, 'fgColor');
set fgColor(String newValue) {
js_util.setProperty(this, 'fgColor', newValue);
}
String get linkColor => js_util.getProperty(this, 'linkColor');
set linkColor(String newValue) {
js_util.setProperty(this, 'linkColor', newValue);
}
String get vlinkColor => js_util.getProperty(this, 'vlinkColor');
set vlinkColor(String newValue) {
js_util.setProperty(this, 'vlinkColor', newValue);
}
String get alinkColor => js_util.getProperty(this, 'alinkColor');
set alinkColor(String newValue) {
js_util.setProperty(this, 'alinkColor', newValue);
}
String get bgColor => js_util.getProperty(this, 'bgColor');
set bgColor(String newValue) {
js_util.setProperty(this, 'bgColor', newValue);
}
HTMLCollection get anchors => js_util.getProperty(this, 'anchors');
HTMLCollection get applets => js_util.getProperty(this, 'applets');
Object clear() => js_util.callMethod(this, 'clear', []);
Object captureEvents() => js_util.callMethod(this, 'captureEvents', []);
Object releaseEvents() => js_util.callMethod(this, 'releaseEvents', []);
HTMLAllCollection get all => js_util.getProperty(this, 'all');
FontMetrics measureElement(Element element) =>
js_util.callMethod(this, 'measureElement', [element]);
FontMetrics measureText(String text, StylePropertyMapReadOnly styleMap) =>
js_util.callMethod(this, 'measureText', [text, styleMap]);
}
@JS()
@staticInterop
class XMLDocument implements Document {
external XMLDocument();
}
@anonymous
@JS()
@staticInterop
class ElementCreationOptions {
external factory ElementCreationOptions({required String mIs});
}
extension PropsElementCreationOptions on ElementCreationOptions {
@JS('is')
@staticInterop
String get mIs => js_util.getProperty(this, 'is');
set mIs(String newValue) {
js_util.setProperty(this, 'is', newValue);
}
}
@JS()
@staticInterop
class DOMImplementation {
external DOMImplementation();
}
extension PropsDOMImplementation on DOMImplementation {
DocumentType createDocumentType(
String qualifiedName, String publicId, String systemId) =>
js_util.callMethod(
this, 'createDocumentType', [qualifiedName, publicId, systemId]);
XMLDocument createDocument(String? namespace, String qualifiedName,
[DocumentType? doctype]) =>
js_util.callMethod(
this, 'createDocument', [namespace, qualifiedName, doctype]);
Document createHTMLDocument([String? title]) =>
js_util.callMethod(this, 'createHTMLDocument', [title]);
bool hasFeature() => js_util.callMethod(this, 'hasFeature', []);
}
@JS()
@staticInterop
class DocumentType implements Node, ChildNode {
external DocumentType();
}
extension PropsDocumentType on DocumentType {
String get name => js_util.getProperty(this, 'name');
String get publicId => js_util.getProperty(this, 'publicId');
String get systemId => js_util.getProperty(this, 'systemId');
}
@JS()
@staticInterop
class DocumentFragment implements Node, NonElementParentNode, ParentNode {
external DocumentFragment();
}
@JS()
@staticInterop
class ShadowRoot implements DocumentFragment, DocumentOrShadowRoot, InnerHTML {
external ShadowRoot();
}
extension PropsShadowRoot on ShadowRoot {
ShadowRootMode get mode =>
ShadowRootMode.values.byName(js_util.getProperty(this, 'mode'));
bool get delegatesFocus => js_util.getProperty(this, 'delegatesFocus');
SlotAssignmentMode get slotAssignment => SlotAssignmentMode.values
.byName(js_util.getProperty(this, 'slotAssignment'));
Element get host => js_util.getProperty(this, 'host');
EventHandlerNonNull? get onslotchange =>
js_util.getProperty(this, 'onslotchange');
set onslotchange(EventHandlerNonNull? newValue) {
js_util.setProperty(this, 'onslotchange', newValue);
}
}
enum ShadowRootMode { open, closed }
enum SlotAssignmentMode { manual, named }
@JS()
@staticInterop
class Element
implements
Node,
Animatable,
ARIAMixin,
GeometryUtils,
Region,
ParentNode,
NonDocumentTypeChildNode,
ChildNode,
Slottable,
InnerHTML {
external Element();
}
extension PropsElement on Element {
String? get namespaceURI => js_util.getProperty(this, 'namespaceURI');
String? get prefix => js_util.getProperty(this, 'prefix');
String get localName => js_util.getProperty(this, 'localName');
String get tagName => js_util.getProperty(this, 'tagName');
String get id => js_util.getProperty(this, 'id');
set id(String newValue) {
js_util.setProperty(this, 'id', newValue);
}
dynamic get className => js_util.getProperty(this, 'className');
set className(dynamic newValue) {
js_util.setProperty(this, 'className', newValue);
}
DOMTokenList get classList => js_util.getProperty(this, 'classList');
String get slot => js_util.getProperty(this, 'slot');
set slot(String newValue) {