pseudo-dom 0.7.0 → 0.8.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 +262 -236
- package/browser/pseudo-dom.js +628 -548
- package/browser/pseudo-dom.min.js +1 -1
- package/dist/classes/PseudoHTMLDocument.d.ts +41 -67
- package/dist/classes/PseudoHTMLDocument.js +74 -144
- package/dist/classes/PseudoHTMLDocument.min.js +1 -1
- package/dist/factories/cssSelectAdapter.d.ts +23 -23
- package/dist/factories/cssSelectAdapter.js +87 -87
- package/dist/factories/query.d.ts +33 -33
- package/dist/factories/query.js +66 -66
- package/dist/functions/getElementById.d.ts +13 -0
- package/dist/functions/getElementById.js +33 -0
- package/dist/functions/getElementById.min.js +1 -0
- package/dist/interfaces/PseudoDocument.d.ts +25 -0
- package/dist/interfaces/PseudoDocumentFragment.d.ts +10 -3
- package/dist/interfaces/PseudoElement.d.ts +702 -702
- package/dist/services/DocumentFragmentService.d.ts +21 -13
- package/dist/services/DocumentFragmentService.js +42 -24
- package/dist/services/DocumentFragmentService.min.js +1 -1
- package/dist/services/DocumentService.d.ts +28 -1
- package/dist/services/DocumentService.js +64 -15
- package/dist/services/DocumentService.min.js +1 -1
- package/dist/services/ElementService.d.ts +191 -191
- package/dist/services/ElementService.js +426 -426
- package/dist/services/HTMLCollectionService.d.ts +54 -54
- package/dist/services/HTMLCollectionService.js +92 -92
- package/dist/services/NodeService.d.ts +297 -297
- package/dist/services/NodeService.js +721 -721
- package/package.json +2 -2
- package/dist/classes.d.ts +0 -20
- package/dist/classes.js +0 -31
- package/dist/classes.min.js +0 -1
- package/dist/factories/generateNode.d.ts +0 -32
- package/dist/factories/generateNode.js +0 -85
- package/dist/factories/generateNode.min.js +0 -1
- package/dist/factories.d.ts +0 -11
- package/dist/factories.js +0 -27
- package/dist/factories.min.js +0 -1
- package/dist/functions.d.ts +0 -5
- package/dist/functions.js +0 -23
- package/dist/functions.min.js +0 -1
package/README.md
CHANGED
|
@@ -49,8 +49,14 @@ Selector queries work like the DOM's: \`getElementsByTagName\` / \`getElementsBy
|
|
|
49
49
|
\`querySelector\` / \`querySelectorAll\` (real CSS selectors, via [css-select](https://www.npmjs.com/package/css-select)
|
|
50
50
|
matched against pseudo-dom's own tree through a custom adapter - \`querySelectorAll\` is a plain array, a snapshot
|
|
51
51
|
taken when it is called, like the DOM's) are on \`NodeService\` so \`Document\`, \`DocumentFragment\` and \`Element\`
|
|
52
|
-
all have them; \`matches\` / \`closest\` are on \`ElementService\`; \`getElementById\` is on \`DocumentService\`
|
|
53
|
-
|
|
52
|
+
all have them; \`matches\` / \`closest\` are on \`ElementService\`; \`getElementById\` is on both \`DocumentService\`
|
|
53
|
+
and \`DocumentFragmentService\` (the DOM's \`NonElementParentNode\` mixin, so a \`ShadowRoot\` gets it too), matching
|
|
54
|
+
the real DOM.
|
|
55
|
+
|
|
56
|
+
\`DocumentService\` matches the real \`Document\` (it is not an \`Element\`, so it has no \`tagName\` / \`classList\` /
|
|
57
|
+
\`matches\` / etc.): \`createElement\`, \`createTextNode\`, \`createComment\`, \`createDocumentFragment\`,
|
|
58
|
+
\`getElementById\`, and \`textContent\` always \`null\`. \`PseudoHTMLDocument\` (what \`generateDocument\` actually
|
|
59
|
+
creates) only adds the \`html\` / \`head\` / \`body\` structure on top.
|
|
54
60
|
|
|
55
61
|
Not implemented yet (these throw a "not implemented" error or are missing): \`getElementsByTagNameNS\`, \`innerHTML\` /
|
|
56
62
|
\`outerHTML\` parsing, and most of the rest of the Element and Document APIs. The API will change before 1.0.
|
|
@@ -134,16 +140,14 @@ not part of a tree, when it is inserted its children are moved into the tree ins
|
|
|
134
140
|
<dt><a href="#AttrService">AttrService</a> ⇐ <code><a href="#NodeService">NodeService</a></code></dt>
|
|
135
141
|
<dd><p>Simulate the behaviour of the Attr Class when there is no DOM available.</p>
|
|
136
142
|
</dd>
|
|
137
|
-
<dt><a href="#LinkedNode">LinkedNode</a> ⇐ <code><a href="#NodeService">NodeService</a></code></dt>
|
|
138
|
-
<dd><p>A node which is stored in a TreeLinker (for example by a list built from an array of values). It finds its siblings
|
|
139
|
-
from that linker, and its parent from the linker's parent when it has not been given one by appendChild.</p>
|
|
140
|
-
</dd>
|
|
141
143
|
<dt><a href="#PseudoNodeList">PseudoNodeList</a> ⇐ <code>LinkedTreeList</code></dt>
|
|
142
144
|
<dd><p>A NodeList, like the DOM one, iterates over the nodes themselves (the data stored in each TreeLinker), rather than
|
|
143
145
|
the linkers that hold them.</p>
|
|
144
146
|
</dd>
|
|
145
|
-
<dt><a href="#PseudoHTMLDocument">PseudoHTMLDocument</a> ⇐ <code>
|
|
146
|
-
<dd><p>Simulate the behaviour of the HTMLDocument Class when there is no DOM available
|
|
147
|
+
<dt><a href="#PseudoHTMLDocument">PseudoHTMLDocument</a> ⇐ <code><a href="#DocumentService">DocumentService</a></code></dt>
|
|
148
|
+
<dd><p>Simulate the behaviour of the HTMLDocument Class when there is no DOM available. Like the real HTMLDocument, this
|
|
149
|
+
only adds the html/head/body structure on top of what Document already gives (createElement, createTextNode,
|
|
150
|
+
createComment, createDocumentFragment, getElementById, textContent always null).</p>
|
|
147
151
|
</dd>
|
|
148
152
|
<dt><a href="#PseudoEventListener">PseudoEventListener</a></dt>
|
|
149
153
|
<dd><p>Handle events as they are stored and implemented.</p>
|
|
@@ -167,8 +171,6 @@ The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop,
|
|
|
167
171
|
<dt><a href="#focused">focused</a></dt>
|
|
168
172
|
<dd><p>The element which has the focus, kept for each tree (the root node of the tree it is in), like document.activeElement.</p>
|
|
169
173
|
</dd>
|
|
170
|
-
<dt><a href="#HTMLElementService_1">HTMLElementService_1</a> : <code>PseudoHTMLElement</code></dt>
|
|
171
|
-
<dd></dd>
|
|
172
174
|
</dl>
|
|
173
175
|
|
|
174
176
|
## Functions
|
|
@@ -198,10 +200,6 @@ order in which an event travels down through them). A node which has no parent h
|
|
|
198
200
|
<dt><a href="#generateNodeList">generateNodeList([innerList])</a> ⇒ <code><a href="#PseudoNodeList">PseudoNodeList</a></code></dt>
|
|
199
201
|
<dd><p>Create a PseudoNodeList, optionally starting from an existing chain of linkers.</p>
|
|
200
202
|
</dd>
|
|
201
|
-
<dt><a href="#generateNode">generateNode()</a> ⇒ <code>function</code></dt>
|
|
202
|
-
<dd><p>Create a TreeLinker class whose linkers each store a node (a LinkedNode) as their data, this can be used to build a
|
|
203
|
-
tree (or list) of nodes from plain values.</p>
|
|
204
|
-
</dd>
|
|
205
203
|
<dt><a href="#generateDocument">generateDocument(root, context)</a> ⇒ <code>Window</code> | <code>PseudoEventTarget</code></dt>
|
|
206
204
|
<dd><p>Construct the Pseudo Dom to provide access to Dom objects which are otherwise not available outside the browser
|
|
207
205
|
context.</p>
|
|
@@ -2493,6 +2491,10 @@ Simulate the behaviour of the Document Class when there is no DOM available.
|
|
|
2493
2491
|
* [DocumentService](#DocumentService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
2494
2492
|
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
2495
2493
|
* [.getElementById(id)](#DocumentService+getElementById) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
2494
|
+
* [.createElement([tagName])](#DocumentService+createElement) ⇒ <code>PseudoElement</code>
|
|
2495
|
+
* [.createTextNode([data])](#DocumentService+createTextNode) ⇒ [<code>TextService</code>](#TextService)
|
|
2496
|
+
* [.createComment([data])](#DocumentService+createComment) ⇒ [<code>CommentService</code>](#CommentService)
|
|
2497
|
+
* [.createDocumentFragment()](#DocumentService+createDocumentFragment) ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2496
2498
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
2497
2499
|
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
2498
2500
|
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
@@ -2535,6 +2537,46 @@ The first element, in tree order, whose id matches the given value, or null when
|
|
|
2535
2537
|
| --- | --- |
|
|
2536
2538
|
| id | <code>string</code> |
|
|
2537
2539
|
|
|
2540
|
+
<a name="DocumentService+createElement"></a>
|
|
2541
|
+
|
|
2542
|
+
### documentService.createElement([tagName]) ⇒ <code>PseudoElement</code>
|
|
2543
|
+
Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
|
|
2544
|
+
|
|
2545
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
2546
|
+
|
|
2547
|
+
| Param | Type | Default | Description |
|
|
2548
|
+
| --- | --- | --- | --- |
|
|
2549
|
+
| [tagName] | <code>string</code> | <code>"'div'"</code> | The type of element to create |
|
|
2550
|
+
|
|
2551
|
+
<a name="DocumentService+createTextNode"></a>
|
|
2552
|
+
|
|
2553
|
+
### documentService.createTextNode([data]) ⇒ [<code>TextService</code>](#TextService)
|
|
2554
|
+
Make a text node which belongs to this document.
|
|
2555
|
+
|
|
2556
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
2557
|
+
|
|
2558
|
+
| Param | Type | Default | Description |
|
|
2559
|
+
| --- | --- | --- | --- |
|
|
2560
|
+
| [data] | <code>string</code> | <code>"''"</code> | The text |
|
|
2561
|
+
|
|
2562
|
+
<a name="DocumentService+createComment"></a>
|
|
2563
|
+
|
|
2564
|
+
### documentService.createComment([data]) ⇒ [<code>CommentService</code>](#CommentService)
|
|
2565
|
+
Make a comment which belongs to this document.
|
|
2566
|
+
|
|
2567
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
2568
|
+
|
|
2569
|
+
| Param | Type | Default | Description |
|
|
2570
|
+
| --- | --- | --- | --- |
|
|
2571
|
+
| [data] | <code>string</code> | <code>"''"</code> | The comment |
|
|
2572
|
+
|
|
2573
|
+
<a name="DocumentService+createDocumentFragment"></a>
|
|
2574
|
+
|
|
2575
|
+
### documentService.createDocumentFragment() ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2576
|
+
Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
|
|
2577
|
+
then inserted in one go.
|
|
2578
|
+
|
|
2579
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
2538
2580
|
<a name="NodeService+appendChild"></a>
|
|
2539
2581
|
|
|
2540
2582
|
### documentService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -2840,6 +2882,7 @@ not part of a tree, when it is inserted its children are moved into the tree ins
|
|
|
2840
2882
|
|
|
2841
2883
|
* [DocumentFragmentService](#DocumentFragmentService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
2842
2884
|
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
2885
|
+
* [.getElementById(id)](#DocumentFragmentService+getElementById) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
2843
2886
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
2844
2887
|
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
2845
2888
|
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
@@ -2871,6 +2914,18 @@ not part of a tree, when it is inserted its children are moved into the tree ins
|
|
|
2871
2914
|
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
2872
2915
|
|
|
2873
2916
|
**Kind**: instance property of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2917
|
+
<a name="DocumentFragmentService+getElementById"></a>
|
|
2918
|
+
|
|
2919
|
+
### documentFragmentService.getElementById(id) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
2920
|
+
The first element, in tree order, whose id matches the given value, or null when there is none (the DOM's
|
|
2921
|
+
NonElementParentNode mixin, which Document and DocumentFragment both implement).
|
|
2922
|
+
|
|
2923
|
+
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2924
|
+
|
|
2925
|
+
| Param | Type |
|
|
2926
|
+
| --- | --- |
|
|
2927
|
+
| id | <code>string</code> |
|
|
2928
|
+
|
|
2874
2929
|
<a name="NodeService+appendChild"></a>
|
|
2875
2930
|
|
|
2876
2931
|
### documentFragmentService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -3622,21 +3677,69 @@ Replace a child of this node with another node (which is moved if it is already
|
|
|
3622
3677
|
| newChild | <code>PseudoNode</code> | The node which takes the place |
|
|
3623
3678
|
| oldChild | <code>PseudoNode</code> | The child of this node to replace |
|
|
3624
3679
|
|
|
3625
|
-
<a name="
|
|
3680
|
+
<a name="PseudoNodeList"></a>
|
|
3626
3681
|
|
|
3627
|
-
##
|
|
3628
|
-
A
|
|
3629
|
-
|
|
3682
|
+
## PseudoNodeList ⇐ <code>LinkedTreeList</code>
|
|
3683
|
+
A NodeList, like the DOM one, iterates over the nodes themselves (the data stored in each TreeLinker), rather than
|
|
3684
|
+
the linkers that hold them.
|
|
3630
3685
|
|
|
3631
3686
|
**Kind**: global class
|
|
3632
|
-
**Extends**:
|
|
3687
|
+
**Extends**: <code>LinkedTreeList</code>
|
|
3688
|
+
|
|
3689
|
+
* [PseudoNodeList](#PseudoNodeList) ⇐ <code>LinkedTreeList</code>
|
|
3690
|
+
* [.entries()](#PseudoNodeList+entries) ⇒ <code>Iterator</code>
|
|
3691
|
+
* [.keys()](#PseudoNodeList+keys) ⇒ <code>Iterator</code>
|
|
3692
|
+
* [.values()](#PseudoNodeList+values) ⇒ <code>Iterator</code>
|
|
3693
|
+
|
|
3694
|
+
<a name="PseudoNodeList+entries"></a>
|
|
3695
|
+
|
|
3696
|
+
### pseudoNodeList.entries() ⇒ <code>Iterator</code>
|
|
3697
|
+
Iterate over [index, node] pairs.
|
|
3698
|
+
|
|
3699
|
+
**Kind**: instance method of [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
3700
|
+
<a name="PseudoNodeList+keys"></a>
|
|
3701
|
+
|
|
3702
|
+
### pseudoNodeList.keys() ⇒ <code>Iterator</code>
|
|
3703
|
+
Iterate over the indexes.
|
|
3704
|
+
|
|
3705
|
+
**Kind**: instance method of [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
3706
|
+
<a name="PseudoNodeList+values"></a>
|
|
3707
|
+
|
|
3708
|
+
### pseudoNodeList.values() ⇒ <code>Iterator</code>
|
|
3709
|
+
Iterate over the nodes.
|
|
3710
|
+
|
|
3711
|
+
**Kind**: instance method of [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
3712
|
+
<a name="PseudoHTMLDocument"></a>
|
|
3713
|
+
|
|
3714
|
+
## PseudoHTMLDocument ⇐ [<code>DocumentService</code>](#DocumentService)
|
|
3715
|
+
Simulate the behaviour of the HTMLDocument Class when there is no DOM available. Like the real HTMLDocument, this
|
|
3716
|
+
only adds the html/head/body structure on top of what Document already gives (createElement, createTextNode,
|
|
3717
|
+
createComment, createDocumentFragment, getElementById, textContent always null).
|
|
3718
|
+
|
|
3719
|
+
**Kind**: global class
|
|
3720
|
+
**Extends**: [<code>DocumentService</code>](#DocumentService)
|
|
3633
3721
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
3722
|
+
**Properties**
|
|
3634
3723
|
|
|
3635
|
-
|
|
3636
|
-
|
|
3724
|
+
| Name | Type | Description |
|
|
3725
|
+
| --- | --- | --- |
|
|
3726
|
+
| head | <code>PseudoHTMLElement</code> | A reference to the Head child element |
|
|
3727
|
+
| body | <code>PseudoHTMLElement</code> | A reference to the Body child element |
|
|
3728
|
+
|
|
3729
|
+
|
|
3730
|
+
* [PseudoHTMLDocument](#PseudoHTMLDocument) ⇐ [<code>DocumentService</code>](#DocumentService)
|
|
3731
|
+
* [new PseudoHTMLDocument()](#new_PseudoHTMLDocument_new)
|
|
3732
|
+
* [.head](#PseudoHTMLDocument+head) : <code>PseudoHTMLElement</code>
|
|
3733
|
+
* [.body](#PseudoHTMLDocument+body) : <code>PseudoHTMLElement</code>
|
|
3637
3734
|
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
3735
|
+
* [.cloneShallow()](#PseudoHTMLDocument+cloneShallow) ⇒ [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3736
|
+
* [.cloneNode([deep])](#PseudoHTMLDocument+cloneNode) ⇒ [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3737
|
+
* [.getElementById(id)](#DocumentService+getElementById) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
3738
|
+
* [.createElement([tagName])](#DocumentService+createElement) ⇒ <code>PseudoElement</code>
|
|
3739
|
+
* [.createTextNode([data])](#DocumentService+createTextNode) ⇒ [<code>TextService</code>](#TextService)
|
|
3740
|
+
* [.createComment([data])](#DocumentService+createComment) ⇒ [<code>CommentService</code>](#CommentService)
|
|
3741
|
+
* [.createDocumentFragment()](#DocumentService+createDocumentFragment) ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
3638
3742
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
3639
|
-
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
3640
3743
|
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
3641
3744
|
* [.append(...nodes)](#NodeService+append)
|
|
3642
3745
|
* [.prepend(...nodes)](#NodeService+prepend)
|
|
@@ -3651,7 +3754,6 @@ from that linker, and its parent from the linker's parent when it has not been g
|
|
|
3651
3754
|
* [.querySelector(selectors)](#NodeService+querySelector) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
3652
3755
|
* [.querySelectorAll(selectors)](#NodeService+querySelectorAll) ⇒ <code>Array.<PseudoElement></code>
|
|
3653
3756
|
* [.childInserted(child)](#NodeService+childInserted)
|
|
3654
|
-
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
3655
3757
|
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
3656
3758
|
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
3657
3759
|
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
@@ -3660,28 +3762,113 @@ from that linker, and its parent from the linker's parent when it has not been g
|
|
|
3660
3762
|
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
3661
3763
|
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
3662
3764
|
|
|
3663
|
-
<a name="
|
|
3765
|
+
<a name="new_PseudoHTMLDocument_new"></a>
|
|
3766
|
+
|
|
3767
|
+
### new PseudoHTMLDocument()
|
|
3768
|
+
The root HTML element is acts as the parent to all HTML elements in the document.
|
|
3664
3769
|
|
|
3665
|
-
|
|
3770
|
+
<a name="PseudoHTMLDocument+head"></a>
|
|
3666
3771
|
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3772
|
+
### pseudoHTMLDocument.head : <code>PseudoHTMLElement</code>
|
|
3773
|
+
Create document head element
|
|
3774
|
+
|
|
3775
|
+
**Kind**: instance property of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3776
|
+
<a name="PseudoHTMLDocument+body"></a>
|
|
3671
3777
|
|
|
3778
|
+
### pseudoHTMLDocument.body : <code>PseudoHTMLElement</code>
|
|
3779
|
+
Create document body element
|
|
3780
|
+
|
|
3781
|
+
**Kind**: instance property of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3672
3782
|
<a name="NodeService+acceptsChildren"></a>
|
|
3673
3783
|
|
|
3674
|
-
###
|
|
3784
|
+
### pseudoHTMLDocument.acceptsChildren ⇒ <code>boolean</code>
|
|
3675
3785
|
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
3676
3786
|
|
|
3677
|
-
**Kind**: instance property of [<code>
|
|
3787
|
+
**Kind**: instance property of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3678
3788
|
**Overrides**: [<code>acceptsChildren</code>](#NodeService+acceptsChildren)
|
|
3789
|
+
<a name="PseudoHTMLDocument+cloneShallow"></a>
|
|
3790
|
+
|
|
3791
|
+
### pseudoHTMLDocument.cloneShallow() ⇒ [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3792
|
+
A copy of this document with none of its html/head/body (cloneNode, from the inherited cloneShallow hook, fills
|
|
3793
|
+
them back in, deep copies own document's, empty otherwise - see cloneNode).
|
|
3794
|
+
|
|
3795
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3796
|
+
**Overrides**: [<code>cloneShallow</code>](#NodeService+cloneShallow)
|
|
3797
|
+
<a name="PseudoHTMLDocument+cloneNode"></a>
|
|
3798
|
+
|
|
3799
|
+
### pseudoHTMLDocument.cloneNode([deep]) ⇒ [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3800
|
+
Make a copy of this document. The copy has no parent or listeners, and a deep copy has copies of everything in
|
|
3801
|
+
the document (a shallow one is an empty document).
|
|
3802
|
+
|
|
3803
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3804
|
+
**Overrides**: [<code>cloneNode</code>](#NodeService+cloneNode)
|
|
3805
|
+
|
|
3806
|
+
| Param | Type | Default | Description |
|
|
3807
|
+
| --- | --- | --- | --- |
|
|
3808
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy everything in the document as well |
|
|
3809
|
+
|
|
3810
|
+
<a name="DocumentService+getElementById"></a>
|
|
3811
|
+
|
|
3812
|
+
### pseudoHTMLDocument.getElementById(id) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
3813
|
+
The first element, in tree order, whose id matches the given value, or null when there is none.
|
|
3814
|
+
|
|
3815
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3816
|
+
**Overrides**: [<code>getElementById</code>](#DocumentService+getElementById)
|
|
3817
|
+
|
|
3818
|
+
| Param | Type |
|
|
3819
|
+
| --- | --- |
|
|
3820
|
+
| id | <code>string</code> |
|
|
3821
|
+
|
|
3822
|
+
<a name="DocumentService+createElement"></a>
|
|
3823
|
+
|
|
3824
|
+
### pseudoHTMLDocument.createElement([tagName]) ⇒ <code>PseudoElement</code>
|
|
3825
|
+
Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
|
|
3826
|
+
|
|
3827
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3828
|
+
**Overrides**: [<code>createElement</code>](#DocumentService+createElement)
|
|
3829
|
+
|
|
3830
|
+
| Param | Type | Default | Description |
|
|
3831
|
+
| --- | --- | --- | --- |
|
|
3832
|
+
| [tagName] | <code>string</code> | <code>"'div'"</code> | The type of element to create |
|
|
3833
|
+
|
|
3834
|
+
<a name="DocumentService+createTextNode"></a>
|
|
3835
|
+
|
|
3836
|
+
### pseudoHTMLDocument.createTextNode([data]) ⇒ [<code>TextService</code>](#TextService)
|
|
3837
|
+
Make a text node which belongs to this document.
|
|
3838
|
+
|
|
3839
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3840
|
+
**Overrides**: [<code>createTextNode</code>](#DocumentService+createTextNode)
|
|
3841
|
+
|
|
3842
|
+
| Param | Type | Default | Description |
|
|
3843
|
+
| --- | --- | --- | --- |
|
|
3844
|
+
| [data] | <code>string</code> | <code>"''"</code> | The text |
|
|
3845
|
+
|
|
3846
|
+
<a name="DocumentService+createComment"></a>
|
|
3847
|
+
|
|
3848
|
+
### pseudoHTMLDocument.createComment([data]) ⇒ [<code>CommentService</code>](#CommentService)
|
|
3849
|
+
Make a comment which belongs to this document.
|
|
3850
|
+
|
|
3851
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3852
|
+
**Overrides**: [<code>createComment</code>](#DocumentService+createComment)
|
|
3853
|
+
|
|
3854
|
+
| Param | Type | Default | Description |
|
|
3855
|
+
| --- | --- | --- | --- |
|
|
3856
|
+
| [data] | <code>string</code> | <code>"''"</code> | The comment |
|
|
3857
|
+
|
|
3858
|
+
<a name="DocumentService+createDocumentFragment"></a>
|
|
3859
|
+
|
|
3860
|
+
### pseudoHTMLDocument.createDocumentFragment() ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
3861
|
+
Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
|
|
3862
|
+
then inserted in one go.
|
|
3863
|
+
|
|
3864
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3865
|
+
**Overrides**: [<code>createDocumentFragment</code>](#DocumentService+createDocumentFragment)
|
|
3679
3866
|
<a name="NodeService+appendChild"></a>
|
|
3680
3867
|
|
|
3681
|
-
###
|
|
3868
|
+
### pseudoHTMLDocument.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
3682
3869
|
Add a node as the last child of this node (a node which is already in a tree is moved).
|
|
3683
3870
|
|
|
3684
|
-
**Kind**: instance method of [<code>
|
|
3871
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3685
3872
|
**Overrides**: [<code>appendChild</code>](#NodeService+appendChild)
|
|
3686
3873
|
**Returns**: <code>PseudoNode</code> - The added node
|
|
3687
3874
|
|
|
@@ -3689,21 +3876,13 @@ Add a node as the last child of this node (a node which is already in a tree is
|
|
|
3689
3876
|
| --- | --- | --- |
|
|
3690
3877
|
| childNode | <code>PseudoNode</code> | The node to add |
|
|
3691
3878
|
|
|
3692
|
-
<a name="NodeService+cloneShallow"></a>
|
|
3693
|
-
|
|
3694
|
-
### linkedNode.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
3695
|
-
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
3696
|
-
Kinds of node which are made with arguments override this to give them.
|
|
3697
|
-
|
|
3698
|
-
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
3699
|
-
**Overrides**: [<code>cloneShallow</code>](#NodeService+cloneShallow)
|
|
3700
3879
|
<a name="NodeService+equalsShallow"></a>
|
|
3701
3880
|
|
|
3702
|
-
###
|
|
3881
|
+
### pseudoHTMLDocument.equalsShallow(other) ⇒ <code>boolean</code>
|
|
3703
3882
|
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
3704
3883
|
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
3705
3884
|
|
|
3706
|
-
**Kind**: instance method of [<code>
|
|
3885
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3707
3886
|
**Overrides**: [<code>equalsShallow</code>](#NodeService+equalsShallow)
|
|
3708
3887
|
|
|
3709
3888
|
| Param | Type | Description |
|
|
@@ -3712,10 +3891,10 @@ afterwards. Kinds of node with more to compare (an element has attributes) overr
|
|
|
3712
3891
|
|
|
3713
3892
|
<a name="NodeService+append"></a>
|
|
3714
3893
|
|
|
3715
|
-
###
|
|
3894
|
+
### pseudoHTMLDocument.append(...nodes)
|
|
3716
3895
|
Add nodes (strings become text nodes) as the last children of this node, in the order given.
|
|
3717
3896
|
|
|
3718
|
-
**Kind**: instance method of [<code>
|
|
3897
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3719
3898
|
**Overrides**: [<code>append</code>](#NodeService+append)
|
|
3720
3899
|
**Throws**:
|
|
3721
3900
|
|
|
@@ -3728,10 +3907,10 @@ Add nodes (strings become text nodes) as the last children of this node, in the
|
|
|
3728
3907
|
|
|
3729
3908
|
<a name="NodeService+prepend"></a>
|
|
3730
3909
|
|
|
3731
|
-
###
|
|
3910
|
+
### pseudoHTMLDocument.prepend(...nodes)
|
|
3732
3911
|
Add nodes (strings become text nodes) as the first children of this node, in the order given.
|
|
3733
3912
|
|
|
3734
|
-
**Kind**: instance method of [<code>
|
|
3913
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3735
3914
|
**Overrides**: [<code>prepend</code>](#NodeService+prepend)
|
|
3736
3915
|
**Throws**:
|
|
3737
3916
|
|
|
@@ -3744,10 +3923,10 @@ Add nodes (strings become text nodes) as the first children of this node, in the
|
|
|
3744
3923
|
|
|
3745
3924
|
<a name="NodeService+replaceChildren"></a>
|
|
3746
3925
|
|
|
3747
|
-
###
|
|
3926
|
+
### pseudoHTMLDocument.replaceChildren(...nodes)
|
|
3748
3927
|
Remove every child of this node and put the given nodes (strings become text nodes) in their place, in order.
|
|
3749
3928
|
|
|
3750
|
-
**Kind**: instance method of [<code>
|
|
3929
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3751
3930
|
**Overrides**: [<code>replaceChildren</code>](#NodeService+replaceChildren)
|
|
3752
3931
|
**Throws**:
|
|
3753
3932
|
|
|
@@ -3760,11 +3939,11 @@ Remove every child of this node and put the given nodes (strings become text nod
|
|
|
3760
3939
|
|
|
3761
3940
|
<a name="NodeService+before"></a>
|
|
3762
3941
|
|
|
3763
|
-
###
|
|
3942
|
+
### pseudoHTMLDocument.before(...nodes)
|
|
3764
3943
|
Add nodes (strings become text nodes) as this node's previous siblings, in order. Does nothing when this node has
|
|
3765
3944
|
no parent.
|
|
3766
3945
|
|
|
3767
|
-
**Kind**: instance method of [<code>
|
|
3946
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3768
3947
|
**Overrides**: [<code>before</code>](#NodeService+before)
|
|
3769
3948
|
|
|
3770
3949
|
| Param | Type | Description |
|
|
@@ -3773,11 +3952,11 @@ no parent.
|
|
|
3773
3952
|
|
|
3774
3953
|
<a name="NodeService+after"></a>
|
|
3775
3954
|
|
|
3776
|
-
###
|
|
3955
|
+
### pseudoHTMLDocument.after(...nodes)
|
|
3777
3956
|
Add nodes (strings become text nodes) as this node's next siblings, in order. Does nothing when this node has no
|
|
3778
3957
|
parent.
|
|
3779
3958
|
|
|
3780
|
-
**Kind**: instance method of [<code>
|
|
3959
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3781
3960
|
**Overrides**: [<code>after</code>](#NodeService+after)
|
|
3782
3961
|
|
|
3783
3962
|
| Param | Type | Description |
|
|
@@ -3786,11 +3965,11 @@ parent.
|
|
|
3786
3965
|
|
|
3787
3966
|
<a name="NodeService+replaceWith"></a>
|
|
3788
3967
|
|
|
3789
|
-
###
|
|
3968
|
+
### pseudoHTMLDocument.replaceWith(...nodes)
|
|
3790
3969
|
Put the given nodes (strings become text nodes) where this node is, in order, then remove this node. Does nothing
|
|
3791
3970
|
when this node has no parent.
|
|
3792
3971
|
|
|
3793
|
-
**Kind**: instance method of [<code>
|
|
3972
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3794
3973
|
**Overrides**: [<code>replaceWith</code>](#NodeService+replaceWith)
|
|
3795
3974
|
|
|
3796
3975
|
| Param | Type | Description |
|
|
@@ -3799,18 +3978,18 @@ when this node has no parent.
|
|
|
3799
3978
|
|
|
3800
3979
|
<a name="NodeService+remove"></a>
|
|
3801
3980
|
|
|
3802
|
-
###
|
|
3981
|
+
### pseudoHTMLDocument.remove()
|
|
3803
3982
|
Remove this node from its parent. Does nothing when it has no parent.
|
|
3804
3983
|
|
|
3805
|
-
**Kind**: instance method of [<code>
|
|
3984
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3806
3985
|
**Overrides**: [<code>remove</code>](#NodeService+remove)
|
|
3807
3986
|
<a name="NodeService+toChildNode"></a>
|
|
3808
3987
|
|
|
3809
|
-
###
|
|
3988
|
+
### pseudoHTMLDocument.toChildNode(value) ⇒ <code>PseudoNode</code>
|
|
3810
3989
|
Turn a value given to append / prepend / before / after / replaceWith / replaceChildren into a node: a string
|
|
3811
3990
|
becomes a text node belonging to this node's document, anything else is returned as it is.
|
|
3812
3991
|
|
|
3813
|
-
**Kind**: instance method of [<code>
|
|
3992
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3814
3993
|
**Overrides**: [<code>toChildNode</code>](#NodeService+toChildNode)
|
|
3815
3994
|
|
|
3816
3995
|
| Param | Type | Description |
|
|
@@ -3819,10 +3998,10 @@ becomes a text node belonging to this node's document, anything else is returned
|
|
|
3819
3998
|
|
|
3820
3999
|
<a name="NodeService+getElementsByTagName"></a>
|
|
3821
4000
|
|
|
3822
|
-
###
|
|
4001
|
+
### pseudoHTMLDocument.getElementsByTagName(tagName) ⇒ <code>PseudoHTMLCollection</code>
|
|
3823
4002
|
Every element below this node with the given tag name (or every element when tagName is *), live.
|
|
3824
4003
|
|
|
3825
|
-
**Kind**: instance method of [<code>
|
|
4004
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3826
4005
|
**Overrides**: [<code>getElementsByTagName</code>](#NodeService+getElementsByTagName)
|
|
3827
4006
|
|
|
3828
4007
|
| Param | Type |
|
|
@@ -3831,10 +4010,10 @@ Every element below this node with the given tag name (or every element when tag
|
|
|
3831
4010
|
|
|
3832
4011
|
<a name="NodeService+getElementsByClassName"></a>
|
|
3833
4012
|
|
|
3834
|
-
###
|
|
4013
|
+
### pseudoHTMLDocument.getElementsByClassName(className) ⇒ <code>PseudoHTMLCollection</code>
|
|
3835
4014
|
Every element below this node which has all of the given (space separated) classes, live.
|
|
3836
4015
|
|
|
3837
|
-
**Kind**: instance method of [<code>
|
|
4016
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3838
4017
|
**Overrides**: [<code>getElementsByClassName</code>](#NodeService+getElementsByClassName)
|
|
3839
4018
|
|
|
3840
4019
|
| Param | Type |
|
|
@@ -3843,10 +4022,10 @@ Every element below this node which has all of the given (space separated) class
|
|
|
3843
4022
|
|
|
3844
4023
|
<a name="NodeService+querySelector"></a>
|
|
3845
4024
|
|
|
3846
|
-
###
|
|
4025
|
+
### pseudoHTMLDocument.querySelector(selectors) ⇒ <code>PseudoElement</code> \| <code>null</code>
|
|
3847
4026
|
The first element below this node which matches the CSS selector, in tree order, or null when there is none.
|
|
3848
4027
|
|
|
3849
|
-
**Kind**: instance method of [<code>
|
|
4028
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3850
4029
|
**Overrides**: [<code>querySelector</code>](#NodeService+querySelector)
|
|
3851
4030
|
|
|
3852
4031
|
| Param | Type | Description |
|
|
@@ -3855,11 +4034,11 @@ The first element below this node which matches the CSS selector, in tree order,
|
|
|
3855
4034
|
|
|
3856
4035
|
<a name="NodeService+querySelectorAll"></a>
|
|
3857
4036
|
|
|
3858
|
-
###
|
|
4037
|
+
### pseudoHTMLDocument.querySelectorAll(selectors) ⇒ <code>Array.<PseudoElement></code>
|
|
3859
4038
|
Every element below this node which matches the CSS selector, in tree order. A plain array (not a live
|
|
3860
4039
|
collection): like the DOM's querySelectorAll, it is a snapshot taken when it is called.
|
|
3861
4040
|
|
|
3862
|
-
**Kind**: instance method of [<code>
|
|
4041
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3863
4042
|
**Overrides**: [<code>querySelectorAll</code>](#NodeService+querySelectorAll)
|
|
3864
4043
|
|
|
3865
4044
|
| Param | Type | Description |
|
|
@@ -3868,39 +4047,26 @@ collection): like the DOM's querySelectorAll, it is a snapshot taken when it is
|
|
|
3868
4047
|
|
|
3869
4048
|
<a name="NodeService+childInserted"></a>
|
|
3870
4049
|
|
|
3871
|
-
###
|
|
4050
|
+
### pseudoHTMLDocument.childInserted(child)
|
|
3872
4051
|
Called each time a node has been inserted as a child of this node, so that nodes which need to react to children
|
|
3873
4052
|
(for example elements applying default events) can do so.
|
|
3874
4053
|
|
|
3875
|
-
**Kind**: instance method of [<code>
|
|
4054
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3876
4055
|
**Overrides**: [<code>childInserted</code>](#NodeService+childInserted)
|
|
3877
4056
|
|
|
3878
4057
|
| Param | Type | Description |
|
|
3879
4058
|
| --- | --- | --- |
|
|
3880
4059
|
| child | [<code>NodeService</code>](#NodeService) | The node which was inserted |
|
|
3881
4060
|
|
|
3882
|
-
<a name="NodeService+cloneNode"></a>
|
|
3883
|
-
|
|
3884
|
-
### linkedNode.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
3885
|
-
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
3886
|
-
too, all the way down.
|
|
3887
|
-
|
|
3888
|
-
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
3889
|
-
**Overrides**: [<code>cloneNode</code>](#NodeService+cloneNode)
|
|
3890
|
-
|
|
3891
|
-
| Param | Type | Default | Description |
|
|
3892
|
-
| --- | --- | --- | --- |
|
|
3893
|
-
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
3894
|
-
|
|
3895
4061
|
<a name="NodeService+compareDocumentPosition"></a>
|
|
3896
4062
|
|
|
3897
|
-
###
|
|
4063
|
+
### pseudoHTMLDocument.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
3898
4064
|
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
3899
4065
|
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
3900
4066
|
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
3901
4067
|
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
3902
4068
|
|
|
3903
|
-
**Kind**: instance method of [<code>
|
|
4069
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3904
4070
|
**Overrides**: [<code>compareDocumentPosition</code>](#NodeService+compareDocumentPosition)
|
|
3905
4071
|
|
|
3906
4072
|
| Param | Type | Description |
|
|
@@ -3909,10 +4075,10 @@ otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
|
3909
4075
|
|
|
3910
4076
|
<a name="NodeService+contains"></a>
|
|
3911
4077
|
|
|
3912
|
-
###
|
|
4078
|
+
### pseudoHTMLDocument.contains(otherNode) ⇒ <code>boolean</code>
|
|
3913
4079
|
Check whether a node is this node or one of its descendants.
|
|
3914
4080
|
|
|
3915
|
-
**Kind**: instance method of [<code>
|
|
4081
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3916
4082
|
**Overrides**: [<code>contains</code>](#NodeService+contains)
|
|
3917
4083
|
|
|
3918
4084
|
| Param | Type | Description |
|
|
@@ -3921,11 +4087,11 @@ Check whether a node is this node or one of its descendants.
|
|
|
3921
4087
|
|
|
3922
4088
|
<a name="NodeService+insertBefore"></a>
|
|
3923
4089
|
|
|
3924
|
-
###
|
|
4090
|
+
### pseudoHTMLDocument.insertBefore(newNode, [referenceNode]) ⇒ <code>PseudoNode</code>
|
|
3925
4091
|
Insert a node as a child of this node, before the given child (or at the end when there is none). A node which is
|
|
3926
4092
|
already in a tree is moved, and the children of a document fragment are moved in order.
|
|
3927
4093
|
|
|
3928
|
-
**Kind**: instance method of [<code>
|
|
4094
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3929
4095
|
**Overrides**: [<code>insertBefore</code>](#NodeService+insertBefore)
|
|
3930
4096
|
**Returns**: <code>PseudoNode</code> - The inserted node
|
|
3931
4097
|
**Throws**:
|
|
@@ -3940,11 +4106,11 @@ already in a tree is moved, and the children of a document fragment are moved in
|
|
|
3940
4106
|
|
|
3941
4107
|
<a name="NodeService+isEqualNode"></a>
|
|
3942
4108
|
|
|
3943
|
-
###
|
|
4109
|
+
### pseudoHTMLDocument.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
3944
4110
|
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
3945
4111
|
needs the same attributes), and children which are equal in the same order.
|
|
3946
4112
|
|
|
3947
|
-
**Kind**: instance method of [<code>
|
|
4113
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3948
4114
|
**Overrides**: [<code>isEqualNode</code>](#NodeService+isEqualNode)
|
|
3949
4115
|
|
|
3950
4116
|
| Param | Type | Description |
|
|
@@ -3953,17 +4119,17 @@ needs the same attributes), and children which are equal in the same order.
|
|
|
3953
4119
|
|
|
3954
4120
|
<a name="NodeService+normalize"></a>
|
|
3955
4121
|
|
|
3956
|
-
###
|
|
4122
|
+
### pseudoHTMLDocument.normalize()
|
|
3957
4123
|
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
3958
4124
|
|
|
3959
|
-
**Kind**: instance method of [<code>
|
|
4125
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3960
4126
|
**Overrides**: [<code>normalize</code>](#NodeService+normalize)
|
|
3961
4127
|
<a name="NodeService+removeChild"></a>
|
|
3962
4128
|
|
|
3963
|
-
###
|
|
4129
|
+
### pseudoHTMLDocument.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
3964
4130
|
Remove a child from this node, it no longer has a parent or siblings afterwards.
|
|
3965
4131
|
|
|
3966
|
-
**Kind**: instance method of [<code>
|
|
4132
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3967
4133
|
**Overrides**: [<code>removeChild</code>](#NodeService+removeChild)
|
|
3968
4134
|
**Returns**: <code>PseudoNode</code> - The removed node
|
|
3969
4135
|
**Throws**:
|
|
@@ -3977,10 +4143,10 @@ Remove a child from this node, it no longer has a parent or siblings afterwards.
|
|
|
3977
4143
|
|
|
3978
4144
|
<a name="NodeService+replaceChild"></a>
|
|
3979
4145
|
|
|
3980
|
-
###
|
|
4146
|
+
### pseudoHTMLDocument.replaceChild(newChild, oldChild) ⇒ <code>PseudoNode</code>
|
|
3981
4147
|
Replace a child of this node with another node (which is moved if it is already in a tree).
|
|
3982
4148
|
|
|
3983
|
-
**Kind**: instance method of [<code>
|
|
4149
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
3984
4150
|
**Overrides**: [<code>replaceChild</code>](#NodeService+replaceChild)
|
|
3985
4151
|
**Returns**: <code>PseudoNode</code> - The replaced node
|
|
3986
4152
|
**Throws**:
|
|
@@ -3993,134 +4159,6 @@ Replace a child of this node with another node (which is moved if it is already
|
|
|
3993
4159
|
| newChild | <code>PseudoNode</code> | The node which takes the place |
|
|
3994
4160
|
| oldChild | <code>PseudoNode</code> | The child of this node to replace |
|
|
3995
4161
|
|
|
3996
|
-
<a name="PseudoNodeList"></a>
|
|
3997
|
-
|
|
3998
|
-
## PseudoNodeList ⇐ <code>LinkedTreeList</code>
|
|
3999
|
-
A NodeList, like the DOM one, iterates over the nodes themselves (the data stored in each TreeLinker), rather than
|
|
4000
|
-
the linkers that hold them.
|
|
4001
|
-
|
|
4002
|
-
**Kind**: global class
|
|
4003
|
-
**Extends**: <code>LinkedTreeList</code>
|
|
4004
|
-
|
|
4005
|
-
* [PseudoNodeList](#PseudoNodeList) ⇐ <code>LinkedTreeList</code>
|
|
4006
|
-
* [.entries()](#PseudoNodeList+entries) ⇒ <code>Iterator</code>
|
|
4007
|
-
* [.keys()](#PseudoNodeList+keys) ⇒ <code>Iterator</code>
|
|
4008
|
-
* [.values()](#PseudoNodeList+values) ⇒ <code>Iterator</code>
|
|
4009
|
-
|
|
4010
|
-
<a name="PseudoNodeList+entries"></a>
|
|
4011
|
-
|
|
4012
|
-
### pseudoNodeList.entries() ⇒ <code>Iterator</code>
|
|
4013
|
-
Iterate over [index, node] pairs.
|
|
4014
|
-
|
|
4015
|
-
**Kind**: instance method of [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
4016
|
-
<a name="PseudoNodeList+keys"></a>
|
|
4017
|
-
|
|
4018
|
-
### pseudoNodeList.keys() ⇒ <code>Iterator</code>
|
|
4019
|
-
Iterate over the indexes.
|
|
4020
|
-
|
|
4021
|
-
**Kind**: instance method of [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
4022
|
-
<a name="PseudoNodeList+values"></a>
|
|
4023
|
-
|
|
4024
|
-
### pseudoNodeList.values() ⇒ <code>Iterator</code>
|
|
4025
|
-
Iterate over the nodes.
|
|
4026
|
-
|
|
4027
|
-
**Kind**: instance method of [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
4028
|
-
<a name="PseudoHTMLDocument"></a>
|
|
4029
|
-
|
|
4030
|
-
## PseudoHTMLDocument ⇐ <code>PseudoHTMLElement</code>
|
|
4031
|
-
Simulate the behaviour of the HTMLDocument Class when there is no DOM available.
|
|
4032
|
-
|
|
4033
|
-
**Kind**: global class
|
|
4034
|
-
**Extends**: <code>PseudoHTMLElement</code>
|
|
4035
|
-
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
4036
|
-
**Properties**
|
|
4037
|
-
|
|
4038
|
-
| Name | Type | Description |
|
|
4039
|
-
| --- | --- | --- |
|
|
4040
|
-
| head | <code>PseudoHTMLElement</code> | A reference to the Head child element |
|
|
4041
|
-
| body | <code>PseudoHTMLElement</code> | A reference to the Body child element |
|
|
4042
|
-
| createElement | <code>function</code> | Generate a new PseudoHTMLElement (which is not in the document until it is appended) |
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
* [PseudoHTMLDocument](#PseudoHTMLDocument) ⇐ <code>PseudoHTMLElement</code>
|
|
4046
|
-
* [new PseudoHTMLDocument()](#new_PseudoHTMLDocument_new)
|
|
4047
|
-
* [.head](#PseudoHTMLDocument+head) : <code>PseudoHTMLElement</code>
|
|
4048
|
-
* [.body](#PseudoHTMLDocument+body) : <code>PseudoHTMLElement</code>
|
|
4049
|
-
* [.createElement(tagName)](#PseudoHTMLDocument+createElement) ⇒ <code>PseudoHTMLElement</code>
|
|
4050
|
-
* [.createTextNode([data])](#PseudoHTMLDocument+createTextNode) ⇒ [<code>TextService</code>](#TextService)
|
|
4051
|
-
* [.createComment([data])](#PseudoHTMLDocument+createComment) ⇒ [<code>CommentService</code>](#CommentService)
|
|
4052
|
-
* [.createDocumentFragment()](#PseudoHTMLDocument+createDocumentFragment) ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
4053
|
-
* [.cloneNode([deep])](#PseudoHTMLDocument+cloneNode) ⇒ <code>PseudoNode</code>
|
|
4054
|
-
|
|
4055
|
-
<a name="new_PseudoHTMLDocument_new"></a>
|
|
4056
|
-
|
|
4057
|
-
### new PseudoHTMLDocument()
|
|
4058
|
-
The root HTML element is acts as the parent to all HTML elements in the document.
|
|
4059
|
-
|
|
4060
|
-
<a name="PseudoHTMLDocument+head"></a>
|
|
4061
|
-
|
|
4062
|
-
### pseudoHTMLDocument.head : <code>PseudoHTMLElement</code>
|
|
4063
|
-
Create document head element
|
|
4064
|
-
|
|
4065
|
-
**Kind**: instance property of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4066
|
-
<a name="PseudoHTMLDocument+body"></a>
|
|
4067
|
-
|
|
4068
|
-
### pseudoHTMLDocument.body : <code>PseudoHTMLElement</code>
|
|
4069
|
-
Create document body element
|
|
4070
|
-
|
|
4071
|
-
**Kind**: instance property of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4072
|
-
<a name="PseudoHTMLDocument+createElement"></a>
|
|
4073
|
-
|
|
4074
|
-
### pseudoHTMLDocument.createElement(tagName) ⇒ <code>PseudoHTMLElement</code>
|
|
4075
|
-
Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
|
|
4076
|
-
|
|
4077
|
-
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4078
|
-
|
|
4079
|
-
| Param | Type | Default | Description |
|
|
4080
|
-
| --- | --- | --- | --- |
|
|
4081
|
-
| tagName | <code>string</code> | <code>"div"</code> | Tag Name is a string representing the type of Dom element this represents |
|
|
4082
|
-
|
|
4083
|
-
<a name="PseudoHTMLDocument+createTextNode"></a>
|
|
4084
|
-
|
|
4085
|
-
### pseudoHTMLDocument.createTextNode([data]) ⇒ [<code>TextService</code>](#TextService)
|
|
4086
|
-
Make a text node which belongs to this document.
|
|
4087
|
-
|
|
4088
|
-
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4089
|
-
|
|
4090
|
-
| Param | Type | Default | Description |
|
|
4091
|
-
| --- | --- | --- | --- |
|
|
4092
|
-
| [data] | <code>string</code> | <code>"''"</code> | The text |
|
|
4093
|
-
|
|
4094
|
-
<a name="PseudoHTMLDocument+createComment"></a>
|
|
4095
|
-
|
|
4096
|
-
### pseudoHTMLDocument.createComment([data]) ⇒ [<code>CommentService</code>](#CommentService)
|
|
4097
|
-
Make a comment which belongs to this document.
|
|
4098
|
-
|
|
4099
|
-
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4100
|
-
|
|
4101
|
-
| Param | Type | Default | Description |
|
|
4102
|
-
| --- | --- | --- | --- |
|
|
4103
|
-
| [data] | <code>string</code> | <code>"''"</code> | The comment |
|
|
4104
|
-
|
|
4105
|
-
<a name="PseudoHTMLDocument+createDocumentFragment"></a>
|
|
4106
|
-
|
|
4107
|
-
### pseudoHTMLDocument.createDocumentFragment() ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
4108
|
-
Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
|
|
4109
|
-
then inserted in one go.
|
|
4110
|
-
|
|
4111
|
-
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4112
|
-
<a name="PseudoHTMLDocument+cloneNode"></a>
|
|
4113
|
-
|
|
4114
|
-
### pseudoHTMLDocument.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
4115
|
-
Make a copy of this document. The copy has no parent or listeners, and a deep copy has copies of everything in the
|
|
4116
|
-
document (a shallow one is an empty document).
|
|
4117
|
-
|
|
4118
|
-
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
4119
|
-
|
|
4120
|
-
| Param | Type | Default | Description |
|
|
4121
|
-
| --- | --- | --- | --- |
|
|
4122
|
-
| [deep] | <code>boolean</code> | <code>false</code> | Copy everything in the document as well |
|
|
4123
|
-
|
|
4124
4162
|
<a name="PseudoEventListener"></a>
|
|
4125
4163
|
|
|
4126
4164
|
## PseudoEventListener
|
|
@@ -4263,10 +4301,6 @@ The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop,
|
|
|
4263
4301
|
## focused
|
|
4264
4302
|
The element which has the focus, kept for each tree (the root node of the tree it is in), like document.activeElement.
|
|
4265
4303
|
|
|
4266
|
-
**Kind**: global constant
|
|
4267
|
-
<a name="HTMLElementService_1"></a>
|
|
4268
|
-
|
|
4269
|
-
## HTMLElementService\_1 : <code>PseudoHTMLElement</code>
|
|
4270
4304
|
**Kind**: global constant
|
|
4271
4305
|
<a name="modifierKeys"></a>
|
|
4272
4306
|
|
|
@@ -4352,14 +4386,6 @@ Create a PseudoNodeList, optionally starting from an existing chain of linkers.
|
|
|
4352
4386
|
| --- | --- | --- |
|
|
4353
4387
|
| [innerList] | <code>TreeLinker</code> \| <code>null</code> | <code></code> |
|
|
4354
4388
|
|
|
4355
|
-
<a name="generateNode"></a>
|
|
4356
|
-
|
|
4357
|
-
## generateNode() ⇒ <code>function</code>
|
|
4358
|
-
Create a TreeLinker class whose linkers each store a node (a LinkedNode) as their data, this can be used to build a
|
|
4359
|
-
tree (or list) of nodes from plain values.
|
|
4360
|
-
|
|
4361
|
-
**Kind**: global function
|
|
4362
|
-
**Returns**: <code>function</code> - The NodeFactory class (a TreeLinker) to use as the linker class
|
|
4363
4389
|
<a name="generateDocument"></a>
|
|
4364
4390
|
|
|
4365
4391
|
## generateDocument(root, context) ⇒ <code>Window</code> \| <code>PseudoEventTarget</code>
|