pseudo-dom 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -38,6 +38,13 @@ nodes. There are text and comment nodes (`PseudoText`, `PseudoComment`) and `tex
38
38
  of everything below, and setting it replaces the children with a text node); the document makes them with
39
39
  `createTextNode`, `createComment` and `createDocumentFragment`.
40
40
 
41
+ Elements can be walked and changed like the DOM: \`children\` is a live \`HTMLCollection\` of just the element
42
+ children, \`childElementCount\`, \`firstElementChild\` / \`lastElementChild\` and \`nextElementSibling\` /
43
+ \`previousElementSibling\` skip text and comment nodes. \`append\` / \`prepend\` / \`before\` / \`after\` / \`remove\` /
44
+ \`replaceWith\` / \`replaceChildren\` accept nodes or strings (a string becomes a text node) and move a node already in
45
+ a tree rather than duplicating it; \`insertAdjacentElement\` / \`insertAdjacentText\` insert at beforebegin / afterbegin
46
+ / beforeend / afterend (\`insertAdjacentHTML\` is not implemented, no HTML parsing yet).
47
+
41
48
  Not implemented yet (these throw a "not implemented" error or are missing): `querySelector` /
42
49
  `querySelectorAll`, `innerHTML` / `outerHTML` parsing, and most of the rest of the Element and Document APIs. The API
43
50
  will change before 1.0.
@@ -86,6 +93,10 @@ interface (the mouse, the keyboard, focus and input).</p>
86
93
  <dt><a href="#HTMLElementService">HTMLElementService</a> ⇐ <code>PseudoElement</code></dt>
87
94
  <dd><p>Simulate the behaviour of the HTMLElement Class when there is no DOM available.</p>
88
95
  </dd>
96
+ <dt><a href="#HTMLCollectionService">HTMLCollectionService</a></dt>
97
+ <dd><p>Simulate the behaviour of the HTMLCollection Class when there is no DOM available: a live view of the element
98
+ children of a node, recomputed from its childNodes each time it is used rather than kept in sync as they change.</p>
99
+ </dd>
89
100
  <dt><a href="#FocusEventService">FocusEventService</a> ⇐ <code><a href="#UIEventService">UIEventService</a></code></dt>
90
101
  <dd><p>Simulate the behaviour of the FocusEvent Class when there is no DOM available.</p>
91
102
  </dd>
@@ -437,6 +448,14 @@ Simulate the behaviour of the Node Class when there is no DOM available.
437
448
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
438
449
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
439
450
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
451
+ * [.append(...nodes)](#NodeService+append)
452
+ * [.prepend(...nodes)](#NodeService+prepend)
453
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
454
+ * [.before(...nodes)](#NodeService+before)
455
+ * [.after(...nodes)](#NodeService+after)
456
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
457
+ * [.remove()](#NodeService+remove)
458
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
440
459
  * [.childInserted(child)](#NodeService+childInserted)
441
460
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
442
461
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -484,6 +503,105 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
484
503
  | --- | --- | --- |
485
504
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
486
505
 
506
+ <a name="NodeService+append"></a>
507
+
508
+ ### nodeService.append(...nodes)
509
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
510
+
511
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
512
+ **Throws**:
513
+
514
+ - <code>Error</code> When this kind of node cannot have children
515
+
516
+
517
+ | Param | Type | Description |
518
+ | --- | --- | --- |
519
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
520
+
521
+ <a name="NodeService+prepend"></a>
522
+
523
+ ### nodeService.prepend(...nodes)
524
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
525
+
526
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
527
+ **Throws**:
528
+
529
+ - <code>Error</code> When this kind of node cannot have children
530
+
531
+
532
+ | Param | Type | Description |
533
+ | --- | --- | --- |
534
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
535
+
536
+ <a name="NodeService+replaceChildren"></a>
537
+
538
+ ### nodeService.replaceChildren(...nodes)
539
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
540
+
541
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
542
+ **Throws**:
543
+
544
+ - <code>Error</code> When this kind of node cannot have children
545
+
546
+
547
+ | Param | Type | Description |
548
+ | --- | --- | --- |
549
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
550
+
551
+ <a name="NodeService+before"></a>
552
+
553
+ ### nodeService.before(...nodes)
554
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
555
+ no parent.
556
+
557
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
558
+
559
+ | Param | Type | Description |
560
+ | --- | --- | --- |
561
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
562
+
563
+ <a name="NodeService+after"></a>
564
+
565
+ ### nodeService.after(...nodes)
566
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
567
+ parent.
568
+
569
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
570
+
571
+ | Param | Type | Description |
572
+ | --- | --- | --- |
573
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
574
+
575
+ <a name="NodeService+replaceWith"></a>
576
+
577
+ ### nodeService.replaceWith(...nodes)
578
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
579
+ when this node has no parent.
580
+
581
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
582
+
583
+ | Param | Type | Description |
584
+ | --- | --- | --- |
585
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
586
+
587
+ <a name="NodeService+remove"></a>
588
+
589
+ ### nodeService.remove()
590
+ Remove this node from its parent. Does nothing when it has no parent.
591
+
592
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
593
+ <a name="NodeService+toChildNode"></a>
594
+
595
+ ### nodeService.toChildNode(value) ⇒ <code>PseudoNode</code>
596
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
597
+ becomes a text node belonging to this node's document, anything else is returned as it is.
598
+
599
+ **Kind**: instance method of [<code>NodeService</code>](#NodeService)
600
+
601
+ | Param | Type | Description |
602
+ | --- | --- | --- |
603
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
604
+
487
605
  <a name="NodeService+childInserted"></a>
488
606
 
489
607
  ### nodeService.childInserted(child)
@@ -626,6 +744,14 @@ Simulate the behaviour of the Text Class when there is no DOM available: the tex
626
744
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
627
745
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
628
746
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
747
+ * [.append(...nodes)](#NodeService+append)
748
+ * [.prepend(...nodes)](#NodeService+prepend)
749
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
750
+ * [.before(...nodes)](#NodeService+before)
751
+ * [.after(...nodes)](#NodeService+after)
752
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
753
+ * [.remove()](#NodeService+remove)
754
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
629
755
  * [.childInserted(child)](#NodeService+childInserted)
630
756
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
631
757
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -702,6 +828,113 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
702
828
  | --- | --- | --- |
703
829
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
704
830
 
831
+ <a name="NodeService+append"></a>
832
+
833
+ ### textService.append(...nodes)
834
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
835
+
836
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
837
+ **Overrides**: [<code>append</code>](#NodeService+append)
838
+ **Throws**:
839
+
840
+ - <code>Error</code> When this kind of node cannot have children
841
+
842
+
843
+ | Param | Type | Description |
844
+ | --- | --- | --- |
845
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
846
+
847
+ <a name="NodeService+prepend"></a>
848
+
849
+ ### textService.prepend(...nodes)
850
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
851
+
852
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
853
+ **Overrides**: [<code>prepend</code>](#NodeService+prepend)
854
+ **Throws**:
855
+
856
+ - <code>Error</code> When this kind of node cannot have children
857
+
858
+
859
+ | Param | Type | Description |
860
+ | --- | --- | --- |
861
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
862
+
863
+ <a name="NodeService+replaceChildren"></a>
864
+
865
+ ### textService.replaceChildren(...nodes)
866
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
867
+
868
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
869
+ **Overrides**: [<code>replaceChildren</code>](#NodeService+replaceChildren)
870
+ **Throws**:
871
+
872
+ - <code>Error</code> When this kind of node cannot have children
873
+
874
+
875
+ | Param | Type | Description |
876
+ | --- | --- | --- |
877
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
878
+
879
+ <a name="NodeService+before"></a>
880
+
881
+ ### textService.before(...nodes)
882
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
883
+ no parent.
884
+
885
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
886
+ **Overrides**: [<code>before</code>](#NodeService+before)
887
+
888
+ | Param | Type | Description |
889
+ | --- | --- | --- |
890
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
891
+
892
+ <a name="NodeService+after"></a>
893
+
894
+ ### textService.after(...nodes)
895
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
896
+ parent.
897
+
898
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
899
+ **Overrides**: [<code>after</code>](#NodeService+after)
900
+
901
+ | Param | Type | Description |
902
+ | --- | --- | --- |
903
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
904
+
905
+ <a name="NodeService+replaceWith"></a>
906
+
907
+ ### textService.replaceWith(...nodes)
908
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
909
+ when this node has no parent.
910
+
911
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
912
+ **Overrides**: [<code>replaceWith</code>](#NodeService+replaceWith)
913
+
914
+ | Param | Type | Description |
915
+ | --- | --- | --- |
916
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
917
+
918
+ <a name="NodeService+remove"></a>
919
+
920
+ ### textService.remove()
921
+ Remove this node from its parent. Does nothing when it has no parent.
922
+
923
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
924
+ **Overrides**: [<code>remove</code>](#NodeService+remove)
925
+ <a name="NodeService+toChildNode"></a>
926
+
927
+ ### textService.toChildNode(value) ⇒ <code>PseudoNode</code>
928
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
929
+ becomes a text node belonging to this node's document, anything else is returned as it is.
930
+
931
+ **Kind**: instance method of [<code>TextService</code>](#TextService)
932
+ **Overrides**: [<code>toChildNode</code>](#NodeService+toChildNode)
933
+
934
+ | Param | Type | Description |
935
+ | --- | --- | --- |
936
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
937
+
705
938
  <a name="NodeService+childInserted"></a>
706
939
 
707
940
  ### textService.childInserted(child)
@@ -851,6 +1084,14 @@ Simulate the behaviour of the Comment Class when there is no DOM available: a no
851
1084
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
852
1085
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
853
1086
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
1087
+ * [.append(...nodes)](#NodeService+append)
1088
+ * [.prepend(...nodes)](#NodeService+prepend)
1089
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
1090
+ * [.before(...nodes)](#NodeService+before)
1091
+ * [.after(...nodes)](#NodeService+after)
1092
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
1093
+ * [.remove()](#NodeService+remove)
1094
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
854
1095
  * [.childInserted(child)](#NodeService+childInserted)
855
1096
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
856
1097
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -910,6 +1151,113 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
910
1151
  | --- | --- | --- |
911
1152
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
912
1153
 
1154
+ <a name="NodeService+append"></a>
1155
+
1156
+ ### commentService.append(...nodes)
1157
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
1158
+
1159
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1160
+ **Overrides**: [<code>append</code>](#NodeService+append)
1161
+ **Throws**:
1162
+
1163
+ - <code>Error</code> When this kind of node cannot have children
1164
+
1165
+
1166
+ | Param | Type | Description |
1167
+ | --- | --- | --- |
1168
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
1169
+
1170
+ <a name="NodeService+prepend"></a>
1171
+
1172
+ ### commentService.prepend(...nodes)
1173
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
1174
+
1175
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1176
+ **Overrides**: [<code>prepend</code>](#NodeService+prepend)
1177
+ **Throws**:
1178
+
1179
+ - <code>Error</code> When this kind of node cannot have children
1180
+
1181
+
1182
+ | Param | Type | Description |
1183
+ | --- | --- | --- |
1184
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
1185
+
1186
+ <a name="NodeService+replaceChildren"></a>
1187
+
1188
+ ### commentService.replaceChildren(...nodes)
1189
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
1190
+
1191
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1192
+ **Overrides**: [<code>replaceChildren</code>](#NodeService+replaceChildren)
1193
+ **Throws**:
1194
+
1195
+ - <code>Error</code> When this kind of node cannot have children
1196
+
1197
+
1198
+ | Param | Type | Description |
1199
+ | --- | --- | --- |
1200
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
1201
+
1202
+ <a name="NodeService+before"></a>
1203
+
1204
+ ### commentService.before(...nodes)
1205
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
1206
+ no parent.
1207
+
1208
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1209
+ **Overrides**: [<code>before</code>](#NodeService+before)
1210
+
1211
+ | Param | Type | Description |
1212
+ | --- | --- | --- |
1213
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
1214
+
1215
+ <a name="NodeService+after"></a>
1216
+
1217
+ ### commentService.after(...nodes)
1218
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
1219
+ parent.
1220
+
1221
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1222
+ **Overrides**: [<code>after</code>](#NodeService+after)
1223
+
1224
+ | Param | Type | Description |
1225
+ | --- | --- | --- |
1226
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
1227
+
1228
+ <a name="NodeService+replaceWith"></a>
1229
+
1230
+ ### commentService.replaceWith(...nodes)
1231
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
1232
+ when this node has no parent.
1233
+
1234
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1235
+ **Overrides**: [<code>replaceWith</code>](#NodeService+replaceWith)
1236
+
1237
+ | Param | Type | Description |
1238
+ | --- | --- | --- |
1239
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
1240
+
1241
+ <a name="NodeService+remove"></a>
1242
+
1243
+ ### commentService.remove()
1244
+ Remove this node from its parent. Does nothing when it has no parent.
1245
+
1246
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1247
+ **Overrides**: [<code>remove</code>](#NodeService+remove)
1248
+ <a name="NodeService+toChildNode"></a>
1249
+
1250
+ ### commentService.toChildNode(value) ⇒ <code>PseudoNode</code>
1251
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
1252
+ becomes a text node belonging to this node's document, anything else is returned as it is.
1253
+
1254
+ **Kind**: instance method of [<code>CommentService</code>](#CommentService)
1255
+ **Overrides**: [<code>toChildNode</code>](#NodeService+toChildNode)
1256
+
1257
+ | Param | Type | Description |
1258
+ | --- | --- | --- |
1259
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
1260
+
913
1261
  <a name="NodeService+childInserted"></a>
914
1262
 
915
1263
  ### commentService.childInserted(child)
@@ -1364,6 +1712,64 @@ focus or already has it.
1364
1712
  Take the focus away from the element, when it has it: it gets blur then focusout.
1365
1713
 
1366
1714
  **Kind**: instance method of [<code>HTMLElementService</code>](#HTMLElementService)
1715
+ <a name="HTMLCollectionService"></a>
1716
+
1717
+ ## HTMLCollectionService
1718
+ Simulate the behaviour of the HTMLCollection Class when there is no DOM available: a live view of the element
1719
+ children of a node, recomputed from its childNodes each time it is used rather than kept in sync as they change.
1720
+
1721
+ **Kind**: global class
1722
+ **Author**: Joshua Heagle <joshuaheagle@gmail.com>
1723
+
1724
+ * [HTMLCollectionService](#HTMLCollectionService)
1725
+ * [new HTMLCollectionService(owner)](#new_HTMLCollectionService_new)
1726
+ * [.length](#HTMLCollectionService+length) ⇒ <code>number</code>
1727
+ * [.elements()](#HTMLCollectionService+elements) ⇒ <code>Array.&lt;PseudoNode&gt;</code>
1728
+ * [.item(index)](#HTMLCollectionService+item) ⇒ <code>\*</code>
1729
+ * [.namedItem(name)](#HTMLCollectionService+namedItem) ⇒ <code>\*</code>
1730
+
1731
+ <a name="new_HTMLCollectionService_new"></a>
1732
+
1733
+ ### new HTMLCollectionService(owner)
1734
+
1735
+ | Param | Type | Description |
1736
+ | --- | --- | --- |
1737
+ | owner | [<code>NodeService</code>](#NodeService) | The node whose element children this is a live view of |
1738
+
1739
+ <a name="HTMLCollectionService+length"></a>
1740
+
1741
+ ### htmlCollectionService.length ⇒ <code>number</code>
1742
+ How many elements are in the collection right now.
1743
+
1744
+ **Kind**: instance property of [<code>HTMLCollectionService</code>](#HTMLCollectionService)
1745
+ <a name="HTMLCollectionService+elements"></a>
1746
+
1747
+ ### htmlCollectionService.elements() ⇒ <code>Array.&lt;PseudoNode&gt;</code>
1748
+ The current element children of the owner, in order.
1749
+
1750
+ **Kind**: instance method of [<code>HTMLCollectionService</code>](#HTMLCollectionService)
1751
+ <a name="HTMLCollectionService+item"></a>
1752
+
1753
+ ### htmlCollectionService.item(index) ⇒ <code>\*</code>
1754
+ The element at the given index, or null when there is none.
1755
+
1756
+ **Kind**: instance method of [<code>HTMLCollectionService</code>](#HTMLCollectionService)
1757
+
1758
+ | Param | Type |
1759
+ | --- | --- |
1760
+ | index | <code>number</code> |
1761
+
1762
+ <a name="HTMLCollectionService+namedItem"></a>
1763
+
1764
+ ### htmlCollectionService.namedItem(name) ⇒ <code>\*</code>
1765
+ The element whose id, or (failing that) whose name attribute, is the given value, or null when there is none.
1766
+
1767
+ **Kind**: instance method of [<code>HTMLCollectionService</code>](#HTMLCollectionService)
1768
+
1769
+ | Param | Type |
1770
+ | --- | --- |
1771
+ | name | <code>string</code> |
1772
+
1367
1773
  <a name="FocusEventService"></a>
1368
1774
 
1369
1775
  ## FocusEventService ⇐ [<code>UIEventService</code>](#UIEventService)
@@ -1666,10 +2072,19 @@ Simulate the behaviour of the Element Class when there is no DOM available.
1666
2072
 
1667
2073
  * [ElementService](#ElementService) ⇐ <code>PseudoNode</code>
1668
2074
  * [new ElementService([settings])](#new_ElementService_new)
2075
+ * [.children](#ElementService+children) ⇒ <code>PseudoHTMLCollection</code>
2076
+ * [.childElementCount](#ElementService+childElementCount) ⇒ <code>number</code>
2077
+ * [.firstElementChild](#ElementService+firstElementChild) ⇒ <code>PseudoElement</code> \| <code>null</code>
2078
+ * [.lastElementChild](#ElementService+lastElementChild) ⇒ <code>PseudoElement</code> \| <code>null</code>
2079
+ * [.nextElementSibling](#ElementService+nextElementSibling) ⇒ <code>PseudoElement</code> \| <code>null</code>
2080
+ * [.previousElementSibling](#ElementService+previousElementSibling) ⇒ <code>PseudoElement</code> \| <code>null</code>
1669
2081
  * [.currentAttributes()](#ElementService+currentAttributes) ⇒ <code>Array.&lt;{name: string, value: \*}&gt;</code>
1670
2082
  * [.cloneShallow()](#ElementService+cloneShallow) ⇒ [<code>ElementService</code>](#ElementService)
1671
2083
  * [.equalsShallow(other)](#ElementService+equalsShallow) ⇒ <code>boolean</code>
1672
- * [.applyDefaultEvent()](#ElementService+applyDefaultEvent) ⇒ <code>function</code>
2084
+ * [.insertAdjacentElement(position, element)](#ElementService+insertAdjacentElement) ⇒ [<code>ElementService</code>](#ElementService) \| <code>null</code>
2085
+ * [.insertAdjacentText(position, text)](#ElementService+insertAdjacentText)
2086
+ * [.insertAdjacent(position, node)](#ElementService+insertAdjacent) ⇒ <code>PseudoNode</code> \| <code>null</code>
2087
+ * [.insertAdjacentHTML(position, text)](#ElementService+insertAdjacentHTML)
1673
2088
  * [.childInserted(child)](#ElementService+childInserted)
1674
2089
  * [.hasAttribute(attributeName)](#ElementService+hasAttribute) ⇒ <code>boolean</code>
1675
2090
  * [.setAttribute(attributeName, attributeValue)](#ElementService+setAttribute) ⇒ <code>undefined</code>
@@ -1688,6 +2103,42 @@ Simulate the behaviour of the Element Class when there is no DOM available.
1688
2103
  | [settings.parent] | <code>PseudoNode</code> \| <code>null</code> | <code></code> | The node to add this element to as its last child |
1689
2104
  | [settings.children] | <code>Array.&lt;PseudoNode&gt;</code> | <code>[]</code> | The nodes to start as children |
1690
2105
 
2106
+ <a name="ElementService+children"></a>
2107
+
2108
+ ### elementService.children ⇒ <code>PseudoHTMLCollection</code>
2109
+ A live view of this element's element children (text, comments and the like are not included).
2110
+
2111
+ **Kind**: instance property of [<code>ElementService</code>](#ElementService)
2112
+ <a name="ElementService+childElementCount"></a>
2113
+
2114
+ ### elementService.childElementCount ⇒ <code>number</code>
2115
+ How many element children this element has.
2116
+
2117
+ **Kind**: instance property of [<code>ElementService</code>](#ElementService)
2118
+ <a name="ElementService+firstElementChild"></a>
2119
+
2120
+ ### elementService.firstElementChild ⇒ <code>PseudoElement</code> \| <code>null</code>
2121
+ The first child of this element which is an element, or null when there is none.
2122
+
2123
+ **Kind**: instance property of [<code>ElementService</code>](#ElementService)
2124
+ <a name="ElementService+lastElementChild"></a>
2125
+
2126
+ ### elementService.lastElementChild ⇒ <code>PseudoElement</code> \| <code>null</code>
2127
+ The last child of this element which is an element, or null when there is none.
2128
+
2129
+ **Kind**: instance property of [<code>ElementService</code>](#ElementService)
2130
+ <a name="ElementService+nextElementSibling"></a>
2131
+
2132
+ ### elementService.nextElementSibling ⇒ <code>PseudoElement</code> \| <code>null</code>
2133
+ The sibling after this one which is an element, or null when there is none.
2134
+
2135
+ **Kind**: instance property of [<code>ElementService</code>](#ElementService)
2136
+ <a name="ElementService+previousElementSibling"></a>
2137
+
2138
+ ### elementService.previousElementSibling ⇒ <code>PseudoElement</code> \| <code>null</code>
2139
+ The sibling before this one which is an element, or null when there is none.
2140
+
2141
+ **Kind**: instance property of [<code>ElementService</code>](#ElementService)
1691
2142
  <a name="ElementService+currentAttributes"></a>
1692
2143
 
1693
2144
  ### elementService.currentAttributes() ⇒ <code>Array.&lt;{name: string, value: \*}&gt;</code>
@@ -1714,12 +2165,74 @@ checks before it compares the children.
1714
2165
  | --- | --- | --- |
1715
2166
  | other | [<code>NodeService</code>](#NodeService) | The element to compare with |
1716
2167
 
1717
- <a name="ElementService+applyDefaultEvent"></a>
2168
+ <a name="ElementService+insertAdjacentElement"></a>
2169
+
2170
+ ### elementService.insertAdjacentElement(position, element) ⇒ [<code>ElementService</code>](#ElementService) \| <code>null</code>
2171
+ Put an element at a position relative to this one: beforebegin (before this element, as its previous sibling),
2172
+ afterbegin (as this element's first child), beforeend (as this element's last child) or afterend (after this
2173
+ element, as its next sibling).
2174
+
2175
+ **Kind**: instance method of [<code>ElementService</code>](#ElementService)
2176
+ **Returns**: [<code>ElementService</code>](#ElementService) \| <code>null</code> - The inserted element, or null when the position needed a parent this element does not have
2177
+ **Throws**:
2178
+
2179
+ - <code>Error</code> When the position is not one of the four above
2180
+
2181
+
2182
+ | Param | Type | Description |
2183
+ | --- | --- | --- |
2184
+ | position | <code>string</code> | beforebegin, afterbegin, beforeend or afterend |
2185
+ | element | [<code>ElementService</code>](#ElementService) | The element to insert |
2186
+
2187
+ <a name="ElementService+insertAdjacentText"></a>
2188
+
2189
+ ### elementService.insertAdjacentText(position, text)
2190
+ Put text at a position relative to this element, the same as insertAdjacentElement but the text becomes a text node.
2191
+
2192
+ **Kind**: instance method of [<code>ElementService</code>](#ElementService)
2193
+ **Throws**:
2194
+
2195
+ - <code>Error</code> When the position is not one of the four above
2196
+
2197
+
2198
+ | Param | Type | Description |
2199
+ | --- | --- | --- |
2200
+ | position | <code>string</code> | beforebegin, afterbegin, beforeend or afterend |
2201
+ | text | <code>string</code> | The text to insert |
2202
+
2203
+ <a name="ElementService+insertAdjacent"></a>
2204
+
2205
+ ### elementService.insertAdjacent(position, node) ⇒ <code>PseudoNode</code> \| <code>null</code>
2206
+ Shared implementation for insertAdjacentElement / insertAdjacentText.
2207
+
2208
+ **Kind**: instance method of [<code>ElementService</code>](#ElementService)
2209
+ **Returns**: <code>PseudoNode</code> \| <code>null</code> - The inserted node, or null when the position needed a parent this element does not have
2210
+ **Throws**:
2211
+
2212
+ - <code>Error</code> When the position is not one of the four above
2213
+
2214
+
2215
+ | Param | Type | Description |
2216
+ | --- | --- | --- |
2217
+ | position | <code>string</code> | beforebegin, afterbegin, beforeend or afterend |
2218
+ | node | <code>PseudoNode</code> \| <code>string</code> | The node (or text) to insert |
2219
+
2220
+ <a name="ElementService+insertAdjacentHTML"></a>
1718
2221
 
1719
- ### elementService.applyDefaultEvent() ⇒ <code>function</code>
1720
- Some elements have default behaviour, this registers it when the element is added.
2222
+ ### elementService.insertAdjacentHTML(position, text)
2223
+ Not implemented yet (HTML parsing is out of scope for now).
1721
2224
 
1722
2225
  **Kind**: instance method of [<code>ElementService</code>](#ElementService)
2226
+ **Throws**:
2227
+
2228
+ - <code>Error</code>
2229
+
2230
+
2231
+ | Param | Type | Description |
2232
+ | --- | --- | --- |
2233
+ | position | <code>string</code> | beforebegin, afterbegin, beforeend or afterend |
2234
+ | text | <code>string</code> | The markup which would be parsed |
2235
+
1723
2236
  <a name="ElementService+childInserted"></a>
1724
2237
 
1725
2238
  ### elementService.childInserted(child)
@@ -1791,6 +2304,14 @@ Simulate the behaviour of the Document Class when there is no DOM available.
1791
2304
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
1792
2305
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
1793
2306
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
2307
+ * [.append(...nodes)](#NodeService+append)
2308
+ * [.prepend(...nodes)](#NodeService+prepend)
2309
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
2310
+ * [.before(...nodes)](#NodeService+before)
2311
+ * [.after(...nodes)](#NodeService+after)
2312
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
2313
+ * [.remove()](#NodeService+remove)
2314
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
1794
2315
  * [.childInserted(child)](#NodeService+childInserted)
1795
2316
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
1796
2317
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -1838,6 +2359,105 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
1838
2359
  | --- | --- | --- |
1839
2360
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
1840
2361
 
2362
+ <a name="NodeService+append"></a>
2363
+
2364
+ ### documentService.append(...nodes)
2365
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
2366
+
2367
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2368
+ **Throws**:
2369
+
2370
+ - <code>Error</code> When this kind of node cannot have children
2371
+
2372
+
2373
+ | Param | Type | Description |
2374
+ | --- | --- | --- |
2375
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2376
+
2377
+ <a name="NodeService+prepend"></a>
2378
+
2379
+ ### documentService.prepend(...nodes)
2380
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
2381
+
2382
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2383
+ **Throws**:
2384
+
2385
+ - <code>Error</code> When this kind of node cannot have children
2386
+
2387
+
2388
+ | Param | Type | Description |
2389
+ | --- | --- | --- |
2390
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2391
+
2392
+ <a name="NodeService+replaceChildren"></a>
2393
+
2394
+ ### documentService.replaceChildren(...nodes)
2395
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
2396
+
2397
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2398
+ **Throws**:
2399
+
2400
+ - <code>Error</code> When this kind of node cannot have children
2401
+
2402
+
2403
+ | Param | Type | Description |
2404
+ | --- | --- | --- |
2405
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2406
+
2407
+ <a name="NodeService+before"></a>
2408
+
2409
+ ### documentService.before(...nodes)
2410
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
2411
+ no parent.
2412
+
2413
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2414
+
2415
+ | Param | Type | Description |
2416
+ | --- | --- | --- |
2417
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2418
+
2419
+ <a name="NodeService+after"></a>
2420
+
2421
+ ### documentService.after(...nodes)
2422
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
2423
+ parent.
2424
+
2425
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2426
+
2427
+ | Param | Type | Description |
2428
+ | --- | --- | --- |
2429
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2430
+
2431
+ <a name="NodeService+replaceWith"></a>
2432
+
2433
+ ### documentService.replaceWith(...nodes)
2434
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
2435
+ when this node has no parent.
2436
+
2437
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2438
+
2439
+ | Param | Type | Description |
2440
+ | --- | --- | --- |
2441
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
2442
+
2443
+ <a name="NodeService+remove"></a>
2444
+
2445
+ ### documentService.remove()
2446
+ Remove this node from its parent. Does nothing when it has no parent.
2447
+
2448
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2449
+ <a name="NodeService+toChildNode"></a>
2450
+
2451
+ ### documentService.toChildNode(value) ⇒ <code>PseudoNode</code>
2452
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
2453
+ becomes a text node belonging to this node's document, anything else is returned as it is.
2454
+
2455
+ **Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
2456
+
2457
+ | Param | Type | Description |
2458
+ | --- | --- | --- |
2459
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
2460
+
1841
2461
  <a name="NodeService+childInserted"></a>
1842
2462
 
1843
2463
  ### documentService.childInserted(child)
@@ -1971,6 +2591,14 @@ not part of a tree, when it is inserted its children are moved into the tree ins
1971
2591
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
1972
2592
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
1973
2593
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
2594
+ * [.append(...nodes)](#NodeService+append)
2595
+ * [.prepend(...nodes)](#NodeService+prepend)
2596
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
2597
+ * [.before(...nodes)](#NodeService+before)
2598
+ * [.after(...nodes)](#NodeService+after)
2599
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
2600
+ * [.remove()](#NodeService+remove)
2601
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
1974
2602
  * [.childInserted(child)](#NodeService+childInserted)
1975
2603
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
1976
2604
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -2018,6 +2646,105 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
2018
2646
  | --- | --- | --- |
2019
2647
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
2020
2648
 
2649
+ <a name="NodeService+append"></a>
2650
+
2651
+ ### documentFragmentService.append(...nodes)
2652
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
2653
+
2654
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2655
+ **Throws**:
2656
+
2657
+ - <code>Error</code> When this kind of node cannot have children
2658
+
2659
+
2660
+ | Param | Type | Description |
2661
+ | --- | --- | --- |
2662
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2663
+
2664
+ <a name="NodeService+prepend"></a>
2665
+
2666
+ ### documentFragmentService.prepend(...nodes)
2667
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
2668
+
2669
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2670
+ **Throws**:
2671
+
2672
+ - <code>Error</code> When this kind of node cannot have children
2673
+
2674
+
2675
+ | Param | Type | Description |
2676
+ | --- | --- | --- |
2677
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2678
+
2679
+ <a name="NodeService+replaceChildren"></a>
2680
+
2681
+ ### documentFragmentService.replaceChildren(...nodes)
2682
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
2683
+
2684
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2685
+ **Throws**:
2686
+
2687
+ - <code>Error</code> When this kind of node cannot have children
2688
+
2689
+
2690
+ | Param | Type | Description |
2691
+ | --- | --- | --- |
2692
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2693
+
2694
+ <a name="NodeService+before"></a>
2695
+
2696
+ ### documentFragmentService.before(...nodes)
2697
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
2698
+ no parent.
2699
+
2700
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2701
+
2702
+ | Param | Type | Description |
2703
+ | --- | --- | --- |
2704
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2705
+
2706
+ <a name="NodeService+after"></a>
2707
+
2708
+ ### documentFragmentService.after(...nodes)
2709
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
2710
+ parent.
2711
+
2712
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2713
+
2714
+ | Param | Type | Description |
2715
+ | --- | --- | --- |
2716
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
2717
+
2718
+ <a name="NodeService+replaceWith"></a>
2719
+
2720
+ ### documentFragmentService.replaceWith(...nodes)
2721
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
2722
+ when this node has no parent.
2723
+
2724
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2725
+
2726
+ | Param | Type | Description |
2727
+ | --- | --- | --- |
2728
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
2729
+
2730
+ <a name="NodeService+remove"></a>
2731
+
2732
+ ### documentFragmentService.remove()
2733
+ Remove this node from its parent. Does nothing when it has no parent.
2734
+
2735
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2736
+ <a name="NodeService+toChildNode"></a>
2737
+
2738
+ ### documentFragmentService.toChildNode(value) ⇒ <code>PseudoNode</code>
2739
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
2740
+ becomes a text node belonging to this node's document, anything else is returned as it is.
2741
+
2742
+ **Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
2743
+
2744
+ | Param | Type | Description |
2745
+ | --- | --- | --- |
2746
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
2747
+
2021
2748
  <a name="NodeService+childInserted"></a>
2022
2749
 
2023
2750
  ### documentFragmentService.childInserted(child)
@@ -2236,6 +2963,14 @@ Simulate the behaviour of the Attr Class when there is no DOM available.
2236
2963
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
2237
2964
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
2238
2965
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
2966
+ * [.append(...nodes)](#NodeService+append)
2967
+ * [.prepend(...nodes)](#NodeService+prepend)
2968
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
2969
+ * [.before(...nodes)](#NodeService+before)
2970
+ * [.after(...nodes)](#NodeService+after)
2971
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
2972
+ * [.remove()](#NodeService+remove)
2973
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
2239
2974
  * [.childInserted(child)](#NodeService+childInserted)
2240
2975
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
2241
2976
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -2299,6 +3034,113 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
2299
3034
  | --- | --- | --- |
2300
3035
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
2301
3036
 
3037
+ <a name="NodeService+append"></a>
3038
+
3039
+ ### attrService.append(...nodes)
3040
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
3041
+
3042
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3043
+ **Overrides**: [<code>append</code>](#NodeService+append)
3044
+ **Throws**:
3045
+
3046
+ - <code>Error</code> When this kind of node cannot have children
3047
+
3048
+
3049
+ | Param | Type | Description |
3050
+ | --- | --- | --- |
3051
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3052
+
3053
+ <a name="NodeService+prepend"></a>
3054
+
3055
+ ### attrService.prepend(...nodes)
3056
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
3057
+
3058
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3059
+ **Overrides**: [<code>prepend</code>](#NodeService+prepend)
3060
+ **Throws**:
3061
+
3062
+ - <code>Error</code> When this kind of node cannot have children
3063
+
3064
+
3065
+ | Param | Type | Description |
3066
+ | --- | --- | --- |
3067
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3068
+
3069
+ <a name="NodeService+replaceChildren"></a>
3070
+
3071
+ ### attrService.replaceChildren(...nodes)
3072
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
3073
+
3074
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3075
+ **Overrides**: [<code>replaceChildren</code>](#NodeService+replaceChildren)
3076
+ **Throws**:
3077
+
3078
+ - <code>Error</code> When this kind of node cannot have children
3079
+
3080
+
3081
+ | Param | Type | Description |
3082
+ | --- | --- | --- |
3083
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3084
+
3085
+ <a name="NodeService+before"></a>
3086
+
3087
+ ### attrService.before(...nodes)
3088
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
3089
+ no parent.
3090
+
3091
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3092
+ **Overrides**: [<code>before</code>](#NodeService+before)
3093
+
3094
+ | Param | Type | Description |
3095
+ | --- | --- | --- |
3096
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3097
+
3098
+ <a name="NodeService+after"></a>
3099
+
3100
+ ### attrService.after(...nodes)
3101
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
3102
+ parent.
3103
+
3104
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3105
+ **Overrides**: [<code>after</code>](#NodeService+after)
3106
+
3107
+ | Param | Type | Description |
3108
+ | --- | --- | --- |
3109
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3110
+
3111
+ <a name="NodeService+replaceWith"></a>
3112
+
3113
+ ### attrService.replaceWith(...nodes)
3114
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
3115
+ when this node has no parent.
3116
+
3117
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3118
+ **Overrides**: [<code>replaceWith</code>](#NodeService+replaceWith)
3119
+
3120
+ | Param | Type | Description |
3121
+ | --- | --- | --- |
3122
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
3123
+
3124
+ <a name="NodeService+remove"></a>
3125
+
3126
+ ### attrService.remove()
3127
+ Remove this node from its parent. Does nothing when it has no parent.
3128
+
3129
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3130
+ **Overrides**: [<code>remove</code>](#NodeService+remove)
3131
+ <a name="NodeService+toChildNode"></a>
3132
+
3133
+ ### attrService.toChildNode(value) ⇒ <code>PseudoNode</code>
3134
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
3135
+ becomes a text node belonging to this node's document, anything else is returned as it is.
3136
+
3137
+ **Kind**: instance method of [<code>AttrService</code>](#AttrService)
3138
+ **Overrides**: [<code>toChildNode</code>](#NodeService+toChildNode)
3139
+
3140
+ | Param | Type | Description |
3141
+ | --- | --- | --- |
3142
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
3143
+
2302
3144
  <a name="NodeService+childInserted"></a>
2303
3145
 
2304
3146
  ### attrService.childInserted(child)
@@ -2442,6 +3284,14 @@ from that linker, and its parent from the linker's parent when it has not been g
2442
3284
  * [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
2443
3285
  * [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
2444
3286
  * [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
3287
+ * [.append(...nodes)](#NodeService+append)
3288
+ * [.prepend(...nodes)](#NodeService+prepend)
3289
+ * [.replaceChildren(...nodes)](#NodeService+replaceChildren)
3290
+ * [.before(...nodes)](#NodeService+before)
3291
+ * [.after(...nodes)](#NodeService+after)
3292
+ * [.replaceWith(...nodes)](#NodeService+replaceWith)
3293
+ * [.remove()](#NodeService+remove)
3294
+ * [.toChildNode(value)](#NodeService+toChildNode) ⇒ <code>PseudoNode</code>
2445
3295
  * [.childInserted(child)](#NodeService+childInserted)
2446
3296
  * [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
2447
3297
  * [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
@@ -2502,6 +3352,113 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
2502
3352
  | --- | --- | --- |
2503
3353
  | other | [<code>NodeService</code>](#NodeService) | The node to compare with |
2504
3354
 
3355
+ <a name="NodeService+append"></a>
3356
+
3357
+ ### linkedNode.append(...nodes)
3358
+ Add nodes (strings become text nodes) as the last children of this node, in the order given.
3359
+
3360
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3361
+ **Overrides**: [<code>append</code>](#NodeService+append)
3362
+ **Throws**:
3363
+
3364
+ - <code>Error</code> When this kind of node cannot have children
3365
+
3366
+
3367
+ | Param | Type | Description |
3368
+ | --- | --- | --- |
3369
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3370
+
3371
+ <a name="NodeService+prepend"></a>
3372
+
3373
+ ### linkedNode.prepend(...nodes)
3374
+ Add nodes (strings become text nodes) as the first children of this node, in the order given.
3375
+
3376
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3377
+ **Overrides**: [<code>prepend</code>](#NodeService+prepend)
3378
+ **Throws**:
3379
+
3380
+ - <code>Error</code> When this kind of node cannot have children
3381
+
3382
+
3383
+ | Param | Type | Description |
3384
+ | --- | --- | --- |
3385
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3386
+
3387
+ <a name="NodeService+replaceChildren"></a>
3388
+
3389
+ ### linkedNode.replaceChildren(...nodes)
3390
+ Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
3391
+
3392
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3393
+ **Overrides**: [<code>replaceChildren</code>](#NodeService+replaceChildren)
3394
+ **Throws**:
3395
+
3396
+ - <code>Error</code> When this kind of node cannot have children
3397
+
3398
+
3399
+ | Param | Type | Description |
3400
+ | --- | --- | --- |
3401
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3402
+
3403
+ <a name="NodeService+before"></a>
3404
+
3405
+ ### linkedNode.before(...nodes)
3406
+ Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
3407
+ no parent.
3408
+
3409
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3410
+ **Overrides**: [<code>before</code>](#NodeService+before)
3411
+
3412
+ | Param | Type | Description |
3413
+ | --- | --- | --- |
3414
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3415
+
3416
+ <a name="NodeService+after"></a>
3417
+
3418
+ ### linkedNode.after(...nodes)
3419
+ Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
3420
+ parent.
3421
+
3422
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3423
+ **Overrides**: [<code>after</code>](#NodeService+after)
3424
+
3425
+ | Param | Type | Description |
3426
+ | --- | --- | --- |
3427
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to add |
3428
+
3429
+ <a name="NodeService+replaceWith"></a>
3430
+
3431
+ ### linkedNode.replaceWith(...nodes)
3432
+ Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
3433
+ when this node has no parent.
3434
+
3435
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3436
+ **Overrides**: [<code>replaceWith</code>](#NodeService+replaceWith)
3437
+
3438
+ | Param | Type | Description |
3439
+ | --- | --- | --- |
3440
+ | ...nodes | <code>PseudoNode</code> \| <code>string</code> | The nodes (or text) to put in this node's place |
3441
+
3442
+ <a name="NodeService+remove"></a>
3443
+
3444
+ ### linkedNode.remove()
3445
+ Remove this node from its parent. Does nothing when it has no parent.
3446
+
3447
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3448
+ **Overrides**: [<code>remove</code>](#NodeService+remove)
3449
+ <a name="NodeService+toChildNode"></a>
3450
+
3451
+ ### linkedNode.toChildNode(value) ⇒ <code>PseudoNode</code>
3452
+ Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
3453
+ becomes a text node belonging to this node's document, anything else is returned as it is.
3454
+
3455
+ **Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
3456
+ **Overrides**: [<code>toChildNode</code>](#NodeService+toChildNode)
3457
+
3458
+ | Param | Type | Description |
3459
+ | --- | --- | --- |
3460
+ | value | <code>PseudoNode</code> \| <code>string</code> | The value to add |
3461
+
2505
3462
  <a name="NodeService+childInserted"></a>
2506
3463
 
2507
3464
  ### linkedNode.childInserted(child)