/
Element.cljs
1708 lines (1162 loc) · 52.5 KB
/
Element.cljs
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
(ns web.Element
"Element is the most general base class from which all objects
a `web.Document` inherit. It only has methods and properties
to all kinds of elements. More specific classes inherit from"
(:refer-clojure :exclude [name remove]))
(defn add-event-listener
"Method.
The `web.EventTarget` method addEventListener() sets up a function
will be called whenever the specified event is delivered to the
`target.addEventListener(type, listener[, options]);
target.addEventListener(type, listener[, useCapture]);
target.addEventListener(type, listener[, useCapture, wantsUntrusted ]); // Gecko/Mozilla only`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener`"
[this & args]
(apply (-> this .-addEventListener) (concat [this] args)))
(defn scroll
"Method.
The scroll() method of the `web.Element` interface scrolls the
to a particular set of coordinates inside a given element.
`element.scroll(x-coord, y-coord)
element.scroll(options)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll`"
[this & args]
(apply (-> this .-scroll) (concat [this] args)))
(defn after
"Method.
The ChildNode.after() method inserts a set of `web.Node` or `web.dom.DOMString`
in the children list of this ChildNode's parent, just after this
`web.dom.DOMString` objects are inserted as equivalent `web.Text`
`[Throws, Unscopable]
void ChildNode.after((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/after`"
[this & args]
(apply (-> this .-after) (concat [this] args)))
(defn animate
"Method.
The `web.Element` interface's animate() method is a shortcut
which creates a new `web.animation.Animation`, applies it to
element, then plays the animation. It returns the created `web.animation.Animation`
instance.
`var animation = element.animate(keyframes, options);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/animate`"
[this keyframes options]
(-> this (.animate keyframes options)))
(defn append
"Method.
The ParentNode.append() method inserts a set of `web.Node` objects
`web.dom.DOMString` objects after the last child of the ParentNode.
objects are inserted as equivalent `web.Text` nodes.
`[Throws, Unscopable]
void ParentNode.append((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append`"
[this & args]
(apply (-> this .-append) (concat [this] args)))
(defn attach-shadow
"Method.
The Element.attachShadow() method attaches a shadow DOM tree
the specified element and returns a reference to its `web.shadow-dom.ShadowRoot`.
`var shadowroot = element.attachShadow(shadowRootInit);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow`"
[this shadow-root-init]
(-> this (.attachShadow shadow-root-init)))
(defn before
"Method.
The ChildNode.before() method inserts a set of `web.Node` or
objects in the children list of this ChildNode's parent, just
this ChildNode. `web.dom.DOMString` objects are inserted as equivalent
nodes.
`[Throws, Unscopable]
void ChildNode.before((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/before`"
[this & args]
(apply (-> this .-before) (concat [this] args)))
(defn closest
"Method.
For browsers that do not support Element.closest(), but carry
for element.matches() (or a prefixed equivalent, meaning IE9+),
polyfill exists:
`var closestElement = element.closest(selectors);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/closest`"
[this selectors]
(-> this (.closest selectors)))
(defn computed-style-map
"Method.
The computedStyleMap() method of the `web.Element` interface
a `web.css.StylePropertyMapReadOnly` interface which provides
read-only representation of a CSS declaration block that is an
to `web.cssdom.CSSStyleDeclaration`.
`var stylePropertyMapReadOnly = Element.computedStyleMap()`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/computedStyleMap`"
[this ]
(-> this (.computedStyleMap)))
(defn create-shadow-root
"Method.
Use Element.createShadowRoot to create an instance of shadow
When shadow DOM is created, it is always attached to an existing
After the shadow DOM is created, the element that it is attached
is called the shadow root.
`var shadowroot = element.createShadowRoot();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/createShadowRoot`"
[this ]
(-> this (.createShadowRoot)))
(defn get-animations
"Method.
The getAnimations() method of the `web.Element` interface (specified
the Animatable mixin) returns an array of all `web.animation.Animation`
affecting this element or which are scheduled to do so in future.
can optionally return `web.animation.Animation` objects for descendant
too.
`const animations = Element.getAnimations(options);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getAnimations`"
[this options]
(-> this (.getAnimations options)))
(defn get-attribute
"Method.
The getAttribute() method of the `web.Element` interface returns
value of a specified attribute on the element.
`var attribute = element.getAttribute(attributeName);
where
attribute is a string containing the value of attributeName.
attributeName is the name of the attribute whose value you want to get.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute`"
[this & args]
(apply (-> this .-getAttribute) (concat [this] args)))
(defn get-attribute-names
"Method.
The getAttributeNames() method of the `web.Element` interface
the attribute names of the element as an `js.Array` of strings.
the element has no attributes it returns an empty array.
`let attributeNames = element.getAttributeNames();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNames`"
[this ]
(-> this (.getAttributeNames)))
(defn get-attribute-node
"Method.
Returns the specified attribute of the specified element, as
Attr node.
`var attrNode = element.getAttributeNode(attrName);
attrNode is an Attr node for the attribute.
attrName is a string containing the name of the attribute.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNode`"
[this & args]
(apply (-> this .-getAttributeNode) (concat [this] args)))
(defn get-attribute-node-ns
"Method.
Returns the Attr node for the attribute with the given namespace
name.
`attributeNode = element.getAttributeNodeNS(namespace, nodeName)
attributeNode is the node for specified attribute.
namespace is a string specifying the namespace of the attribute.
nodeName is a string specifying the name of the attribute.
== Example == TBD The example needs to be fixed pre> // html: <div id=\\\"top\\\" /> t = document.getElementById(\\\"top\\\"); specialNode = t.getAttributeNodeNS( \\\"http://www.mozilla.org/ns/specialspace\\\", \\\"id\\\"); // iNode.value = \\\"full-top\\\" </pre`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNodeNS`"
[this & args]
(apply (-> this .-getAttributeNodeNS) (concat [this] args)))
(defn get-attribute-ns
"Method.
The getAttributeNS() method of the `web.Element` interface returns
string value of the attribute with the specified namespace and
If the named attribute does not exist, the value returned will
be null or \\\"\\\" (the empty string); see Notes for details.
`attrVal = element.getAttributeNS(namespace, name)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttributeNS`"
[this namespace name]
(-> this (.getAttributeNS namespace name)))
(defn get-bounding-client-rect
"Method.
The Element.getBoundingClientRect() method returns the size of
element and its position relative to the viewport.
`domRect = element.getBoundingClientRect();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect`"
[this ]
(-> this (.getBoundingClientRect)))
(defn get-client-rects
"Method.
The getClientRects() method of the `web.Element` interface returns
collection of `web.dom.DOMRect` objects that indicate the bounding
for each CSS border box in a client.
`let rectCollection = object.getClientRects();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getClientRects`"
[this ]
(-> this (.getClientRects)))
(defn get-elements-by-class-name
"Method.
The `web.Element` method getElementsByClassName() returns a live
which contains every descendant element which has the specified
name or names.
`var elements = element.getElementsByClassName(names);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByClassName`"
[this names]
(-> this (.getElementsByClassName names)))
(defn get-elements-by-tag-name
"Method.
The Element.getElementsByTagName() method returns a live `web.dom.HTMLCollection`
elements with the given tag name.
`elements = element.getElementsByTagName(tagName)
\\telements is a live `web.dom.HTMLCollection` of elements with a matching tag name, in the order they appear. If no elements are found, the HTMLCollection is empty.
\\telement is the element from where the search starts. Only the element's descendants are included, not the element itself.
\\ttagName is the qualified name to look for. The special string \\\"*\\\" represents all elements. For compatibility with XHTML, lower-case should be used.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagName`"
[this & args]
(apply (-> this .-getElementsByTagName) (concat [this] args)))
(defn get-elements-by-tag-name-ns
"Method.
The Element.getElementsByTagNameNS() method returns a live `web.dom.HTMLCollection`
elements with the given tag name belonging to the given namespace.
is similar to `Document.getElementsByTagNameNS`, except that
search is restricted to descendants of the specified element.
`elements = element.getElementsByTagNameNS(namespaceURI, localName)
elements is a live `web.dom.HTMLCollection` of found elements in the order they appear in the tree.
element is the element from where the search should start. Note that only the descendants of this element are included in the search, not the node itself.
namespaceURI is the namespace URI of elements to look for (see `Element.namespaceURI` and `Attr.namespaceURI`). For example, if you need to look for XHTML elements, use the XHTML namespace URI, http://www.w3.org/1999/xhtml.
localName is either the local name of elements to look for or the special value \\\"*\\\", which matches all elements (see `Element.localName` and `Attr.localName`).`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/getElementsByTagNameNS`"
[this & args]
(apply (-> this .-getElementsByTagNameNS) (concat [this] args)))
(defn has-attribute
"Method.
The Element.hasAttribute() method returns a Boolean value indicating
the specified element has the specified attribute or not.
`var result = element.hasAttribute(name);
result
holds the return value true or false.
name
is a string representing the name of the attribute.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttribute`"
[this & args]
(apply (-> this .-hasAttribute) (concat [this] args)))
(defn has-attribute-ns
"Method.
hasAttributeNS returns a boolean value indicating whether the
element has the specified attribute.
`result = element.hasAttributeNS(namespace,localName)
result is the boolean value true or false.
namespace is a string specifying the namespace of the attribute.
localName is the name of the attribute.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttributeNS`"
[this & args]
(apply (-> this .-hasAttributeNS) (concat [this] args)))
(defn has-attributes
"Method.
The hasAttributes() method of the `web.Element` interface returns
`js.Boolean` indicating whether the current element has any attributes
not.
`var result = element.hasAttributes();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/hasAttributes`"
[this ]
(-> this (.hasAttributes)))
(defn has-pointer-capture
"Method.
The hasPointerCapture() method of the `web.Element` interface
whether the element on which it is invoked has pointer capture
the pointer identified by the given pointer ID.
`targetElement.hasPointerCapture(pointerId);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/hasPointerCapture`"
[this pointer-id]
(-> this (.hasPointerCapture pointer-id)))
(defn insert-adjacent-element
"Method.
The insertAdjacentElement() method of the `web.Element` interface
a given element node at a given position relative to the element
is invoked upon.
`targetElement.insertAdjacentElement(position, element);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentElement`"
[this position element]
(-> this (.insertAdjacentElement position element)))
(defn insert-adjacent-html
"Method.
The insertAdjacentHTML() method of the `web.Element` interface
the specified text as HTML or XML and inserts the resulting nodes
the DOM tree at a specified position. It does not reparse the
it is being used on, and thus it does not corrupt the existing
inside that element. This avoids the extra step of serialization,
it much faster than direct `innerHTML` manipulation.
`element.insertAdjacentHTML(position, text);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML`"
[this position text]
(-> this (.insertAdjacentHTML position text)))
(defn insert-adjacent-text
"Method.
The insertAdjacentText() method of the `web.Element` interface
a given text node at a given position relative to the element
is invoked upon.
`element.insertAdjacentText(position, element);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentText`"
[this position element]
(-> this (.insertAdjacentText position element)))
(defn matches
"Method.
selectorString is a string representing the selector to test.
`var result = element.matches(selectorString);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/matches`"
[this selector-string]
(-> this (.matches selector-string)))
(defn ms-zoom-to
"Method.
The msZoomTo method scrolls and/or zooms an element to its specified
with animation.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/msZoomTo`"
[this & args]
(apply (-> this .-msZoomTo) (concat [this] args)))
(defn prepend
"Method.
The ParentNode.prepend() method inserts a set of `web.Node` objects
`web.dom.DOMString` objects before the first child of the `web.ParentNode`.
objects are inserted as equivalent `web.Text` nodes.
`ParentNode.prepend(...nodesToPrepend);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/prepend`"
[this & args]
(apply (-> this .-prepend) (concat [this] args)))
(defn query-selector
"Method.
The querySelector() method of the `web.Element` interface returns
first element that is a descendant of the element on which it
invoked that matches the specified group of selectors.
`element = baseElement.querySelector(selectors);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector`"
[this selectors]
(-> this (.querySelector selectors)))
(defn query-selector-all
"Method.
The `web.ParentNode` mixin defines the querySelectorAll() method
returning a `web.NodeList` representing a list of elements matching
specified group of selectors which are descendants of the object
which the method was called.
`elementList = parentNode.querySelectorAll(selectors);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/querySelectorAll`"
[this selectors]
(-> this (.querySelectorAll selectors)))
(defn release-pointer-capture
"Method.
The releasePointerCapture() method of the `web.Element` interface
(stops) pointer capture that was previously set for a specific
pointer.
`targetElement.releasePointerCapture(pointerId);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/releasePointerCapture`"
[this pointer-id]
(-> this (.releasePointerCapture pointer-id)))
(defn remove
"Method.
The ChildNode.remove() method removes the object from the tree
belongs to.
`node.remove();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove`"
[this ]
(-> this (.remove)))
(defn remove-attribute
"Method.
The `web.Element` method removeAttribute() removes the attribute
the specified name from the element.
`element.removeAttribute(attrName);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute`"
[this attr-name]
(-> this (.removeAttribute attr-name)))
(defn remove-attribute-node
"Method.
The removeAttributeNode() method of the `web.Element` object
the specified attribute from the current element.
`removedAttr = element.removeAttributeNode(attributeNode)
attributeNode is the Attr node that needs to be removed.
removedAttr is the removed Attr node.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttributeNode`"
[this & args]
(apply (-> this .-removeAttributeNode) (concat [this] args)))
(defn remove-attribute-ns
"Method.
The removeAttributeNS() method of the `web.Element` interface
the specified attribute from an element.
`element.removeAttributeNS(namespace, attrName);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttributeNS`"
[this namespace attr-name]
(-> this (.removeAttributeNS namespace attr-name)))
(defn replace-with
"Method.
The ChildNode.replaceWith() method replaces this ChildNode in
children list of its parent with a set of `web.Node` or `web.dom.DOMString`
`web.dom.DOMString` objects are inserted as equivalent `web.Text`
`[Throws, Unscopable]
void ChildNode.replaceWith((Node or DOMString)... nodes);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/replaceWith`"
[this & args]
(apply (-> this .-replaceWith) (concat [this] args)))
(defn request-fullscreen
"Method.
The Element.requestFullscreen() method issues an asynchronous
to make the element be displayed in full-screen mode.
`var Promise = Element.requestFullscreen(options);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen`"
[this options]
(-> this (.requestFullscreen options)))
(defn request-pointer-lock
"Method.
The Element.requestPointerLock() method lets you asynchronously
for the pointer to be locked on the given element.
`instanceOfElement.requestPointerLock();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/requestPointerLock`"
[this ]
(-> this (.requestPointerLock)))
(defn scroll-by
"Method.
The scrollBy() method of the `web.Element` interface scrolls
element by the given amount.
`element.scrollBy(x-coord, y-coord);
element.scrollBy(options)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy`"
[this & args]
(apply (-> this .-scrollBy) (concat [this] args)))
(defn scroll-into-view
"Method.
The `web.Element` interface's scrollIntoView() method scrolls
element's parent container such that the element on which scrollIntoView()
called is visible to the user
`element.scrollIntoView();
element.scrollIntoView(alignToTop); // Boolean parameter
element.scrollIntoView(scrollIntoViewOptions); // Object parameter`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView`"
[this & args]
(apply (-> this .-scrollIntoView) (concat [this] args)))
(defn scroll-into-view-if-needed
"Method.
The Element.scrollIntoViewIfNeeded() method scrolls the current
into the visible area of the browser window if it's not already
the visible area of the browser window. If the element is already
the visible area of the browser window, then no scrolling takes
This method is a proprietary variation of the standard `Element.scrollIntoView()`
`TODO`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoViewIfNeeded`"
[this ]
(-> this (.scrollIntoViewIfNeeded)))
(defn scroll-to
"Method.
The scrollTo() method of the `web.Element` interface scrolls
a particular set of coordinates inside a given element.
`element.scrollTo(x-coord, y-coord)
element.scrollTo(options)`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollTo`"
[this & args]
(apply (-> this .-scrollTo) (concat [this] args)))
(defn set-attribute
"Method.
Sets the value of an attribute on the specified element. If the
already exists, the value is updated; otherwise a new attribute
added with the specified name and value.
`Element.setAttribute(name, value);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute`"
[this name value]
(-> this (.setAttribute name value)))
(defn set-attribute-node
"Method.
The setAttributeNode() method adds a new Attr node to the specified
`var replacedAttr = element.setAttributeNode(attribute);
attribute is the Attr node to set on the element.
replacedAttr is the replaced attribute node, if any, returned by this function.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttributeNode`"
[this & args]
(apply (-> this .-setAttributeNode) (concat [this] args)))
(defn set-attribute-node-ns
"Method.
setAttributeNodeNS adds a new namespaced attribute node to an
`replacedAttr = element.setAttributeNodeNS(attributeNode)
replacedAttr is the replaced attribute node, if any, returned by this function.
attributeNode is an Attr node.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttributeNodeNS`"
[this & args]
(apply (-> this .-setAttributeNodeNS) (concat [this] args)))
(defn set-attribute-ns
"Method.
setAttributeNS adds a new attribute or changes the value of an
with the given namespace and name.
`element.setAttributeNS(namespace, name, value)
namespace is a string specifying the namespace of the attribute.
name is a string identifying the attribute by its qualified name; that is, a namespace prefix followed by a colon followed by a local name.
value is the desired string value of the new attribute.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttributeNS`"
[this & args]
(apply (-> this .-setAttributeNS) (concat [this] args)))
(defn set-capture
"Method.
Call this method during the handling of a mousedown event to
all mouse events to this element until the mouse button is released
`document.releaseCapture()` is called.
`element.setCapture(retargetToElement);
retargetToElement
If true, all events are targeted directly to this element; if false, events can also fire at descendants of this element.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/setCapture`"
[this & args]
(apply (-> this .-setCapture) (concat [this] args)))
(defn set-pointer-capture
"Method.
The setPointerCapture() method of the `web.Element` interface
used to designate a specific element as the capture target of
pointer events. Subsequent events for the pointer will be targeted
the capture element until capture is released (via `Element.releasePointerCapture()`).
`targetElement.setPointerCapture(pointerId);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/setPointerCapture`"
[this pointer-id]
(-> this (.setPointerCapture pointer-id)))
(defn toggle-attribute
"Method.
The toggleAttribute() method of the `web.Element` interface toggles
Boolean attribute (removing it if it is present and adding it
it is not present) on the given element.
`Element.toggleAttribute(name [, force]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute`"
[this & args]
(apply (-> this .-toggleAttribute) (concat [this] args)))
(defn attributes
"Property.
The Element.attributes property returns a live collection of
attribute nodes registered to the specified node. It is a `web.NamedNodeMap`,
an Array, so it has no `js.Array` methods and the `web.Attr`
indexes may differ among browsers. To be more specific, attributes
a key/value pair of strings that represents any information regarding
attribute.
`var attr = element.attributes;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes`"
[this]
(-> this (.attributes)))
(defn set-attributes!
"Property.
The Element.attributes property returns a live collection of
attribute nodes registered to the specified node. It is a `web.NamedNodeMap`,
an Array, so it has no `js.Array` methods and the `web.Attr`
indexes may differ among browsers. To be more specific, attributes
a key/value pair of strings that represents any information regarding
attribute.
`var attr = element.attributes;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/attributes`"
[this val]
(aset this "attributes" val))
(defn assigned-slot
"Property.
The assignedSlot read-only property of the `web.shadow-dom.Slotable`
returns an `web.shadow-dom.HTMLSlotElement` representing the
element the node is inserted in.
`var slotElement = elementInstance.assignedSlot`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Slotable/assignedSlot`"
[this]
(-> this (.assignedSlot)))
(defn set-assigned-slot!
"Property.
The assignedSlot read-only property of the `web.shadow-dom.Slotable`
returns an `web.shadow-dom.HTMLSlotElement` representing the
element the node is inserted in.
`var slotElement = elementInstance.assignedSlot`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Slotable/assignedSlot`"
[this val]
(aset this "assignedSlot" val))
(defn onfullscreenchange
"Property.
The `web.Element` interface's onfullscreenchange property is
event handler for the fullscreenchange event that is fired when
element has transitioned into or out of full-screen mode.
`targetDocument.onfullscreenchange = fullscreenChangeHandler;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/onfullscreenchange`"
[this]
(-> this (.onfullscreenchange)))
(defn set-onfullscreenchange!
"Property.
The `web.Element` interface's onfullscreenchange property is
event handler for the fullscreenchange event that is fired when
element has transitioned into or out of full-screen mode.
`targetDocument.onfullscreenchange = fullscreenChangeHandler;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/onfullscreenchange`"
[this val]
(aset this "onfullscreenchange" val))
(defn access-key
"Property.
The Element.accessKey property sets the keystroke which a user
press to jump to a given element.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/accessKey`"
[this]
(-> this (.accessKey)))
(defn set-access-key!
"Property.
The Element.accessKey property sets the keystroke which a user
press to jump to a given element.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/accessKey`"
[this val]
(aset this "accessKey" val))
(defn child-element-count
"Property.
The ParentNode.childElementCount read-only property returns an
long representing the number of child elements of the given element.
`var count = node.childElementCount;
count
The return value, which is an unsigned long (simply an integer) type.
node
An object representing a `web.Document`, `web.web-components.DocumentFragment`, or `web.Element`.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/childElementCount`"
[this]
(-> this (.childElementCount)))
(defn set-child-element-count!
"Property.
The ParentNode.childElementCount read-only property returns an
long representing the number of child elements of the given element.
`var count = node.childElementCount;
count
The return value, which is an unsigned long (simply an integer) type.
node
An object representing a `web.Document`, `web.web-components.DocumentFragment`, or `web.Element`.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/childElementCount`"
[this val]
(aset this "childElementCount" val))
(defn children
"Property.
The `web.ParentNode` property children is a read-only property
returns a live `web.dom.HTMLCollection` which contains all of
child `elements` of the node upon which it was called.
`var children = node.children;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children`"
[this]
(-> this (.children)))
(defn set-children!
"Property.
The `web.ParentNode` property children is a read-only property
returns a live `web.dom.HTMLCollection` which contains all of
child `elements` of the node upon which it was called.
`var children = node.children;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children`"
[this val]
(aset this "children" val))
(defn class-list
"Property.
The Element.classList is a read-only property that returns a
`web.dom.DOMTokenList` collection of the class attributes of
element.
`const elementClasses = elementNodeReference.classList;
elementClasses is a `web.dom.DOMTokenList` representing the class attribute of elementNodeReference. If the class attribute was not set or is empty elementClasses.length returns 0. element.classList itself is read-only, although you can modify it using the add() and remove() methods.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/classList`"
[this]
(-> this (.classList)))
(defn class-name
"Property.
The className property of the `web.Element` interface gets and
the value of the `class` of the specified element.
`var cName = elementNodeReference.className;
elementNodeReference.className = cName;
cName is a string variable representing the class or space-separated classes of the current element.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/className`"
[this]
(-> this (.className)))
(defn set-class-name!
"Property.
The className property of the `web.Element` interface gets and
the value of the `class` of the specified element.
`var cName = elementNodeReference.className;
elementNodeReference.className = cName;
cName is a string variable representing the class or space-separated classes of the current element.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/className`"
[this val]
(aset this "className" val))
(defn client-height
"Property.
The Element.clientHeight read-only property is zero for elements
no CSS or inline layout boxes; otherwise, it's the inner height
an element in pixels. It includes padding but excludes borders,
and horizontal scrollbars (if present).
`var intElemClientHeight = element.clientHeight;
intElemClientHeight is an integer corresponding to the clientHeight of element in pixels. The clientHeight property is read–only.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight`"
[this]
(-> this (.clientHeight)))
(defn set-client-height!
"Property.
The Element.clientHeight read-only property is zero for elements
no CSS or inline layout boxes; otherwise, it's the inner height
an element in pixels. It includes padding but excludes borders,
and horizontal scrollbars (if present).
`var intElemClientHeight = element.clientHeight;
intElemClientHeight is an integer corresponding to the clientHeight of element in pixels. The clientHeight property is read–only.`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight`"
[this val]
(aset this "clientHeight" val))
(defn client-left
"Property.
The width of the left border of an element in pixels. It includes
width of the vertical scrollbar if the text direction of the
is right–to–left and if there is an overflow causing a left vertical
to be rendered. clientLeft does not include the left margin or
left padding. clientLeft is read-only.
`var left = element.clientLeft;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Element/clientLeft`"
[this]
(-> this (.clientLeft)))