pseudo-dom 0.3.0 → 0.5.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 +1632 -111
- package/browser/pseudo-dom.js +23759 -1844
- package/browser/pseudo-dom.min.js +1 -1
- package/dist/classes/PseudoHTMLDocument.d.ts +33 -1
- package/dist/classes/PseudoHTMLDocument.js +80 -2
- package/dist/classes/PseudoHTMLDocument.min.js +1 -1
- package/dist/factories/createEvent.d.ts +28 -0
- package/dist/factories/createEvent.js +56 -0
- package/dist/factories/createEvent.min.js +1 -0
- package/dist/factories/eventDefaults.d.ts +31 -0
- package/dist/factories/eventDefaults.js +105 -0
- package/dist/factories/eventDefaults.min.js +1 -0
- package/dist/factories.d.ts +6 -0
- package/dist/factories.js +5 -1
- package/dist/factories.min.js +1 -1
- package/dist/functions/activeElement.d.ts +14 -0
- package/dist/functions/activeElement.js +33 -0
- package/dist/functions/activeElement.min.js +1 -0
- package/dist/functions/modifierState.d.ts +29 -0
- package/dist/functions/modifierState.js +41 -0
- package/dist/functions/modifierState.min.js +1 -0
- package/dist/main.d.ts +35 -1
- package/dist/main.js +81 -1
- package/dist/main.min.js +1 -1
- package/dist/services/AttrService.d.ts +6 -0
- package/dist/services/AttrService.js +24 -0
- package/dist/services/AttrService.min.js +1 -1
- package/dist/services/CommentService.d.ts +1 -0
- package/dist/services/CommentService.js +13 -0
- package/dist/services/CommentService.min.js +1 -0
- package/dist/services/CustomEventService.d.ts +37 -0
- package/dist/services/CustomEventService.js +35 -0
- package/dist/services/CustomEventService.min.js +1 -0
- package/dist/services/ElementService.d.ts +20 -0
- package/dist/services/ElementService.js +82 -15
- package/dist/services/ElementService.min.js +1 -1
- package/dist/services/EventService.d.ts +2 -0
- package/dist/services/EventService.js +7 -1
- package/dist/services/EventService.min.js +1 -1
- package/dist/services/FocusEventService.d.ts +32 -0
- package/dist/services/FocusEventService.js +35 -0
- package/dist/services/FocusEventService.min.js +1 -0
- package/dist/services/HTMLElementService.d.ts +20 -0
- package/dist/services/HTMLElementService.js +95 -0
- package/dist/services/HTMLElementService.min.js +1 -1
- package/dist/services/InputEventService.d.ts +41 -0
- package/dist/services/InputEventService.js +47 -0
- package/dist/services/InputEventService.min.js +1 -0
- package/dist/services/KeyboardEventService.d.ts +70 -0
- package/dist/services/KeyboardEventService.js +86 -0
- package/dist/services/KeyboardEventService.min.js +1 -0
- package/dist/services/MouseEventService.d.ts +80 -0
- package/dist/services/MouseEventService.js +108 -0
- package/dist/services/MouseEventService.min.js +1 -0
- package/dist/services/NodeService.d.ts +105 -8
- package/dist/services/NodeService.js +313 -17
- package/dist/services/NodeService.min.js +1 -1
- package/dist/services/PointerEventService.d.ts +51 -0
- package/dist/services/PointerEventService.js +67 -0
- package/dist/services/PointerEventService.min.js +1 -0
- package/dist/services/TextService.d.ts +1 -0
- package/dist/services/TextService.js +13 -0
- package/dist/services/TextService.min.js +1 -0
- package/dist/services/UIEventService.d.ts +43 -0
- package/dist/services/UIEventService.js +42 -0
- package/dist/services/UIEventService.min.js +1 -0
- package/dist/simulate.d.ts +32 -0
- package/dist/simulate.js +115 -0
- package/dist/simulate.min.js +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -18,12 +18,35 @@ else, document fragments insert their children, and a node cannot be put inside
|
|
|
18
18
|
`DOMTokenListService`, `NamedNodeMapService`, `DocumentService` / `DocumentFragmentService`, `PseudoNodeList`, and
|
|
19
19
|
`generateDocument` for creating a document.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Standard events: `createEvent(type, init, { browser, trusted })` makes the kind of event which suits the type (a click is a
|
|
22
|
+
`MouseEvent`, a keydown a `KeyboardEvent`, ...). Like the constructor in a browser it gives nothing (no bubbling, no
|
|
23
|
+
cancelling, not trusted) unless asked, but with `browser: true` it uses `eventDefaults`, the table of how the browser
|
|
24
|
+
creates each standard type (click bubbles and can be cancelled, focus does not bubble but focusin does, input bubbles
|
|
25
|
+
but cannot be cancelled, ...), and `trusted: true` makes `isTrusted` true, as for a real user action. The kinds of event
|
|
26
|
+
are `PseudoUIEvent`, `PseudoMouseEvent`, `PseudoPointerEvent`, `PseudoKeyboardEvent`, `PseudoFocusEvent`,
|
|
27
|
+
`PseudoInputEvent` and `PseudoCustomEvent`. Elements have `click()` (an untrusted click, like a script's),
|
|
28
|
+
`focus()` and `blur()` (with blur / focusout / focus / focusin and the related targets, and a focused element for each
|
|
29
|
+
tree), and `simulate.click(element)` / `simulate.keyPress(element, key)` send what a user's action sends (pointerdown,
|
|
30
|
+
mousedown, the focus moving, pointerup, mouseup, click; keydown, keyup), all trusted.
|
|
31
|
+
|
|
32
|
+
Nodes can be copied and compared: `cloneNode(deep)` copies an element with its attributes (objects such as `style` are
|
|
33
|
+
copied too, not shared) and, when deep, everything below it, without the parent or the event listeners; `isEqualNode`
|
|
34
|
+
compares two nodes by what they hold (tag, attributes in any order, text and children in order);
|
|
35
|
+
`compareDocumentPosition` says where another node is (`NodeService.DOCUMENT_POSITION_*`); `isConnected` is true when the
|
|
36
|
+
tree has a document at the top and `ownerDocument` says which one made the node; `normalize` joins neighbouring text
|
|
37
|
+
nodes. There are text and comment nodes (`PseudoText`, `PseudoComment`) and `textContent` works like the DOM's (the text
|
|
38
|
+
of everything below, and setting it replaces the children with a text node); the document makes them with
|
|
39
|
+
`createTextNode`, `createComment` and `createDocumentFragment`.
|
|
40
|
+
|
|
41
|
+
Not implemented yet (these throw a "not implemented" error or are missing): `querySelector` /
|
|
22
42
|
`querySelectorAll`, `innerHTML` / `outerHTML` parsing, and most of the rest of the Element and Document APIs. The API
|
|
23
43
|
will change before 1.0.
|
|
24
44
|
## Modules
|
|
25
45
|
|
|
26
46
|
<dl>
|
|
47
|
+
<dt><a href="#module_pseudoDom/simulate">pseudoDom/simulate</a></dt>
|
|
48
|
+
<dd><p>Simulate what a user does, with the events the browser sends for it.</p>
|
|
49
|
+
</dd>
|
|
27
50
|
<dt><a href="#module_pseudoDom/objects">pseudoDom/objects</a> : <code>Object</code></dt>
|
|
28
51
|
<dd><p>All methods exported from this module are encapsulated within pseudoDom.</p>
|
|
29
52
|
</dd>
|
|
@@ -32,15 +55,40 @@ will change before 1.0.
|
|
|
32
55
|
## Classes
|
|
33
56
|
|
|
34
57
|
<dl>
|
|
58
|
+
<dt><a href="#UIEventService">UIEventService</a> ⇐ <code><a href="#EventService">EventService</a></code></dt>
|
|
59
|
+
<dd><p>Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
|
|
60
|
+
interface (the mouse, the keyboard, focus and input).</p>
|
|
61
|
+
</dd>
|
|
62
|
+
<dt><a href="#PointerEventService">PointerEventService</a> ⇐ <code><a href="#MouseEventService">MouseEventService</a></code></dt>
|
|
63
|
+
<dd><p>Simulate the behaviour of the PointerEvent Class when there is no DOM available.</p>
|
|
64
|
+
</dd>
|
|
35
65
|
<dt><a href="#NodeService">NodeService</a> ⇐ <code>PseudoEventTarget</code></dt>
|
|
36
66
|
<dd><p>Simulate the behaviour of the Node Class when there is no DOM available.</p>
|
|
37
67
|
</dd>
|
|
68
|
+
<dt><a href="#TextService">TextService</a> ⇐ <code><a href="#NodeService">NodeService</a></code></dt>
|
|
69
|
+
<dd><p>Simulate the behaviour of the Text Class when there is no DOM available: the text in an element.</p>
|
|
70
|
+
</dd>
|
|
71
|
+
<dt><a href="#CommentService">CommentService</a> ⇐ <code><a href="#NodeService">NodeService</a></code></dt>
|
|
72
|
+
<dd><p>Simulate the behaviour of the Comment Class when there is no DOM available: a note in the markup which is not shown.</p>
|
|
73
|
+
</dd>
|
|
38
74
|
<dt><a href="#NamedNodeMapService">NamedNodeMapService</a></dt>
|
|
39
75
|
<dd><p>Simulate the behaviour of the NamedNodeMap Class when there is no DOM available.</p>
|
|
40
76
|
</dd>
|
|
77
|
+
<dt><a href="#MouseEventService">MouseEventService</a> ⇐ <code><a href="#UIEventService">UIEventService</a></code></dt>
|
|
78
|
+
<dd><p>Simulate the behaviour of the MouseEvent Class when there is no DOM available.</p>
|
|
79
|
+
</dd>
|
|
80
|
+
<dt><a href="#KeyboardEventService">KeyboardEventService</a> ⇐ <code><a href="#UIEventService">UIEventService</a></code></dt>
|
|
81
|
+
<dd><p>Simulate the behaviour of the KeyboardEvent Class when there is no DOM available.</p>
|
|
82
|
+
</dd>
|
|
83
|
+
<dt><a href="#InputEventService">InputEventService</a> ⇐ <code><a href="#UIEventService">UIEventService</a></code></dt>
|
|
84
|
+
<dd><p>Simulate the behaviour of the InputEvent Class when there is no DOM available.</p>
|
|
85
|
+
</dd>
|
|
41
86
|
<dt><a href="#HTMLElementService">HTMLElementService</a> ⇐ <code>PseudoElement</code></dt>
|
|
42
87
|
<dd><p>Simulate the behaviour of the HTMLElement Class when there is no DOM available.</p>
|
|
43
88
|
</dd>
|
|
89
|
+
<dt><a href="#FocusEventService">FocusEventService</a> ⇐ <code><a href="#UIEventService">UIEventService</a></code></dt>
|
|
90
|
+
<dd><p>Simulate the behaviour of the FocusEvent Class when there is no DOM available.</p>
|
|
91
|
+
</dd>
|
|
44
92
|
<dt><a href="#EventTargetService">EventTargetService</a></dt>
|
|
45
93
|
<dd><p>Simulate the behaviour of the EventTarget Class when there is no DOM available.
|
|
46
94
|
Dispatching an event sends it through the tree the way the DOM does: down from the root to the target (capture
|
|
@@ -63,6 +111,9 @@ not part of a tree, when it is inserted its children are moved into the tree ins
|
|
|
63
111
|
<dt><a href="#DOMTokenListService">DOMTokenListService</a></dt>
|
|
64
112
|
<dd><p>Simulate the behaviour of the DOMTokenList Class when there is no DOM available.</p>
|
|
65
113
|
</dd>
|
|
114
|
+
<dt><a href="#CustomEventService">CustomEventService</a> ⇐ <code><a href="#EventService">EventService</a></code></dt>
|
|
115
|
+
<dd><p>Simulate the behaviour of the CustomEvent Class when there is no DOM available: an event which carries data.</p>
|
|
116
|
+
</dd>
|
|
66
117
|
<dt><a href="#AttrService">AttrService</a> ⇐ <code><a href="#NodeService">NodeService</a></code></dt>
|
|
67
118
|
<dd><p>Simulate the behaviour of the Attr Class when there is no DOM available.</p>
|
|
68
119
|
</dd>
|
|
@@ -82,9 +133,23 @@ the linkers that hold them.</p>
|
|
|
82
133
|
</dd>
|
|
83
134
|
</dl>
|
|
84
135
|
|
|
136
|
+
## Members
|
|
137
|
+
|
|
138
|
+
<dl>
|
|
139
|
+
<dt><a href="#eventDefaults">eventDefaults</a> : <code>Object.<string, EventDefinition></code></dt>
|
|
140
|
+
<dd><p>The events which the browser itself creates (for a user action, or for something like element.click()) have these
|
|
141
|
+
options. A script which creates an event with the constructor gets none of them (everything is false) unless it asks
|
|
142
|
+
for them, which is why createEvent only uses this table when it is told the browser is creating the event.
|
|
143
|
+
The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop, Touch and CSS specifications.</p>
|
|
144
|
+
</dd>
|
|
145
|
+
</dl>
|
|
146
|
+
|
|
85
147
|
## Constants
|
|
86
148
|
|
|
87
149
|
<dl>
|
|
150
|
+
<dt><a href="#focused">focused</a></dt>
|
|
151
|
+
<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>
|
|
152
|
+
</dd>
|
|
88
153
|
<dt><a href="#HTMLElementService_1">HTMLElementService_1</a> : <code>PseudoHTMLElement</code></dt>
|
|
89
154
|
<dd></dd>
|
|
90
155
|
</dl>
|
|
@@ -92,6 +157,12 @@ the linkers that hold them.</p>
|
|
|
92
157
|
## Functions
|
|
93
158
|
|
|
94
159
|
<dl>
|
|
160
|
+
<dt><a href="#modifierKeys">modifierKeys([init])</a> ⇒ <code>ModifierKeys</code></dt>
|
|
161
|
+
<dd><p>Pick the modifier keys out of the init object of an event.</p>
|
|
162
|
+
</dd>
|
|
163
|
+
<dt><a href="#modifierState">modifierState(keys, key)</a> ⇒ <code>boolean</code></dt>
|
|
164
|
+
<dd><p>Answer getModifierState for a set of held modifier keys.</p>
|
|
165
|
+
</dd>
|
|
95
166
|
<dt><a href="#getParentNodesFromAttribute">getParentNodesFromAttribute(attr, value, node)</a> ⇒ <code>Array.<PseudoNode></code></dt>
|
|
96
167
|
<dd><p>A selector function for retrieving existing parent PseudoNode from the given child item.
|
|
97
168
|
This function will check all the parents starting from node, and scan the attributes
|
|
@@ -101,6 +172,12 @@ property for matches. The return array contains all matching parent ancestors, s
|
|
|
101
172
|
<dd><p>Get all of the ancestors of a node, starting with the root of the tree and ending with the node's own parent (the
|
|
102
173
|
order in which an event travels down through them). A node which has no parent has no ancestors.</p>
|
|
103
174
|
</dd>
|
|
175
|
+
<dt><a href="#getActiveElement">getActiveElement(root)</a> ⇒ <code>Object</code> | <code>null</code></dt>
|
|
176
|
+
<dd><p>Find the element which has the focus in a tree.</p>
|
|
177
|
+
</dd>
|
|
178
|
+
<dt><a href="#setActiveElement">setActiveElement(root, element)</a></dt>
|
|
179
|
+
<dd><p>Remember the element which has the focus in a tree.</p>
|
|
180
|
+
</dd>
|
|
104
181
|
<dt><a href="#generateNodeList">generateNodeList([innerList])</a> ⇒ <code><a href="#PseudoNodeList">PseudoNodeList</a></code></dt>
|
|
105
182
|
<dd><p>Create a PseudoNodeList, optionally starting from an existing chain of linkers.</p>
|
|
106
183
|
</dd>
|
|
@@ -112,14 +189,232 @@ tree (or list) of nodes from plain values.</p>
|
|
|
112
189
|
<dd><p>Construct the Pseudo Dom to provide access to Dom objects which are otherwise not available outside the browser
|
|
113
190
|
context.</p>
|
|
114
191
|
</dd>
|
|
192
|
+
<dt><a href="#createEvent">createEvent(type, [init], [options])</a> ⇒ <code><a href="#EventService">EventService</a></code></dt>
|
|
193
|
+
<dd><p>Create an event of the kind which suits its type (a click is a MouseEvent, a keydown a KeyboardEvent, ...).
|
|
194
|
+
By default this is like using the constructor of the event in a script: nothing bubbles or can be cancelled unless
|
|
195
|
+
the init says so, and the event is not trusted. With browser: true the event is created the way the browser creates
|
|
196
|
+
it, using the standard options for its type (see eventDefaults), and trusted: true makes it look like it came from a
|
|
197
|
+
real user action (isTrusted).</p>
|
|
198
|
+
</dd>
|
|
115
199
|
</dl>
|
|
116
200
|
|
|
201
|
+
<a name="module_pseudoDom/simulate"></a>
|
|
202
|
+
|
|
203
|
+
## pseudoDom/simulate
|
|
204
|
+
Simulate what a user does, with the events the browser sends for it.
|
|
205
|
+
|
|
206
|
+
**Version**: 1.0.0
|
|
207
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
208
|
+
|
|
209
|
+
* [pseudoDom/simulate](#module_pseudoDom/simulate)
|
|
210
|
+
* [~focusableFrom(element)](#module_pseudoDom/simulate..focusableFrom) ⇒ <code>\*</code> \| <code>null</code>
|
|
211
|
+
* [~click(element, [init])](#module_pseudoDom/simulate..click) ⇒ <code>boolean</code>
|
|
212
|
+
* [~keyPress(element, key, [init])](#module_pseudoDom/simulate..keyPress) ⇒ <code>boolean</code>
|
|
213
|
+
|
|
214
|
+
<a name="module_pseudoDom/simulate..focusableFrom"></a>
|
|
215
|
+
|
|
216
|
+
### pseudoDom/simulate~focusableFrom(element) ⇒ <code>\*</code> \| <code>null</code>
|
|
217
|
+
The nearest element (starting with the element itself) which can have the focus.
|
|
218
|
+
|
|
219
|
+
**Kind**: inner method of [<code>pseudoDom/simulate</code>](#module_pseudoDom/simulate)
|
|
220
|
+
|
|
221
|
+
| Param | Type | Description |
|
|
222
|
+
| --- | --- | --- |
|
|
223
|
+
| element | <code>\*</code> | Where to start |
|
|
224
|
+
|
|
225
|
+
<a name="module_pseudoDom/simulate..click"></a>
|
|
226
|
+
|
|
227
|
+
### pseudoDom/simulate~click(element, [init]) ⇒ <code>boolean</code>
|
|
228
|
+
Click an element the way a user does: pointerdown and mousedown, then the focus moves to the nearest element which
|
|
229
|
+
can have it (or is taken away from the one which had it) unless mousedown was cancelled, then pointerup, mouseup
|
|
230
|
+
and finally click. Every event is trusted and has the options the browser gives it. A disabled element gets nothing.
|
|
231
|
+
|
|
232
|
+
**Kind**: inner method of [<code>pseudoDom/simulate</code>](#module_pseudoDom/simulate)
|
|
233
|
+
**Returns**: <code>boolean</code> - False when the click was cancelled (or the element is disabled), so its default action did not happen
|
|
234
|
+
|
|
235
|
+
| Param | Type | Default | Description |
|
|
236
|
+
| --- | --- | --- | --- |
|
|
237
|
+
| element | <code>\*</code> | | The element to click |
|
|
238
|
+
| [init] | <code>Object</code> | <code>{}</code> | Options for the events (for example clientX, clientY, shiftKey) |
|
|
239
|
+
|
|
240
|
+
<a name="module_pseudoDom/simulate..keyPress"></a>
|
|
241
|
+
|
|
242
|
+
### pseudoDom/simulate~keyPress(element, key, [init]) ⇒ <code>boolean</code>
|
|
243
|
+
Press and release a key on an element (the element which has the focus, or one given): keydown and then keyup.
|
|
244
|
+
|
|
245
|
+
**Kind**: inner method of [<code>pseudoDom/simulate</code>](#module_pseudoDom/simulate)
|
|
246
|
+
**Returns**: <code>boolean</code> - False when keydown was cancelled, so its default action did not happen
|
|
247
|
+
|
|
248
|
+
| Param | Type | Default | Description |
|
|
249
|
+
| --- | --- | --- | --- |
|
|
250
|
+
| element | <code>\*</code> | | The element which gets the key |
|
|
251
|
+
| key | <code>string</code> | | The value of the key, such as a or Enter |
|
|
252
|
+
| [init] | <code>Object</code> | <code>{}</code> | Options for the events (for example code, shiftKey) |
|
|
253
|
+
|
|
117
254
|
<a name="module_pseudoDom/objects"></a>
|
|
118
255
|
|
|
119
256
|
## pseudoDom/objects : <code>Object</code>
|
|
120
257
|
All methods exported from this module are encapsulated within pseudoDom.
|
|
121
258
|
|
|
122
259
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
260
|
+
<a name="UIEventService"></a>
|
|
261
|
+
|
|
262
|
+
## UIEventService ⇐ [<code>EventService</code>](#EventService)
|
|
263
|
+
Simulate the behaviour of the UIEvent Class when there is no DOM available: the events which come from a user
|
|
264
|
+
interface (the mouse, the keyboard, focus and input).
|
|
265
|
+
|
|
266
|
+
**Kind**: global class
|
|
267
|
+
**Extends**: [<code>EventService</code>](#EventService)
|
|
268
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
269
|
+
**Properties**
|
|
270
|
+
|
|
271
|
+
| Name | Type |
|
|
272
|
+
| --- | --- |
|
|
273
|
+
| detail | <code>number</code> |
|
|
274
|
+
| view | <code>\*</code> |
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
* [UIEventService](#UIEventService) ⇐ [<code>EventService</code>](#EventService)
|
|
278
|
+
* [new UIEventService([typeArg], [init])](#new_UIEventService_new)
|
|
279
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
280
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
281
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
282
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
283
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
284
|
+
|
|
285
|
+
<a name="new_UIEventService_new"></a>
|
|
286
|
+
|
|
287
|
+
### new UIEventService([typeArg], [init])
|
|
288
|
+
|
|
289
|
+
| Param | Type | Default | Description |
|
|
290
|
+
| --- | --- | --- | --- |
|
|
291
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
292
|
+
| [init] | <code>UIEventInit</code> | <code>{}</code> | The options for the event |
|
|
293
|
+
|
|
294
|
+
<a name="EventService+inner"></a>
|
|
295
|
+
|
|
296
|
+
### uiEventService.inner ⇒ <code>EventInner</code>
|
|
297
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
298
|
+
|
|
299
|
+
**Kind**: instance property of [<code>UIEventService</code>](#UIEventService)
|
|
300
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
301
|
+
<a name="EventService+composedPath"></a>
|
|
302
|
+
|
|
303
|
+
### uiEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
304
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
305
|
+
|
|
306
|
+
**Kind**: instance method of [<code>UIEventService</code>](#UIEventService)
|
|
307
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
308
|
+
<a name="EventService+preventDefault"></a>
|
|
309
|
+
|
|
310
|
+
### uiEventService.preventDefault() ⇒ <code>null</code>
|
|
311
|
+
Cancels the event (if it is cancelable).
|
|
312
|
+
|
|
313
|
+
**Kind**: instance method of [<code>UIEventService</code>](#UIEventService)
|
|
314
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
315
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
316
|
+
|
|
317
|
+
### uiEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
318
|
+
For this particular event, no other listener will be called.
|
|
319
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
320
|
+
capture phase, for instance)
|
|
321
|
+
|
|
322
|
+
**Kind**: instance method of [<code>UIEventService</code>](#UIEventService)
|
|
323
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
324
|
+
<a name="EventService+stopPropagation"></a>
|
|
325
|
+
|
|
326
|
+
### uiEventService.stopPropagation() ⇒ <code>null</code>
|
|
327
|
+
Stops the propagation of events further along in the Dom.
|
|
328
|
+
|
|
329
|
+
**Kind**: instance method of [<code>UIEventService</code>](#UIEventService)
|
|
330
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
331
|
+
<a name="PointerEventService"></a>
|
|
332
|
+
|
|
333
|
+
## PointerEventService ⇐ [<code>MouseEventService</code>](#MouseEventService)
|
|
334
|
+
Simulate the behaviour of the PointerEvent Class when there is no DOM available.
|
|
335
|
+
|
|
336
|
+
**Kind**: global class
|
|
337
|
+
**Extends**: [<code>MouseEventService</code>](#MouseEventService)
|
|
338
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
339
|
+
**Properties**
|
|
340
|
+
|
|
341
|
+
| Name | Type |
|
|
342
|
+
| --- | --- |
|
|
343
|
+
| pointerId | <code>number</code> |
|
|
344
|
+
| width | <code>number</code> |
|
|
345
|
+
| height | <code>number</code> |
|
|
346
|
+
| pressure | <code>number</code> |
|
|
347
|
+
| pointerType | <code>string</code> |
|
|
348
|
+
| isPrimary | <code>boolean</code> |
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
* [PointerEventService](#PointerEventService) ⇐ [<code>MouseEventService</code>](#MouseEventService)
|
|
352
|
+
* [new PointerEventService([typeArg], [init])](#new_PointerEventService_new)
|
|
353
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
354
|
+
* [.getModifierState(key)](#MouseEventService+getModifierState) ⇒ <code>boolean</code>
|
|
355
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
356
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
357
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
358
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
359
|
+
|
|
360
|
+
<a name="new_PointerEventService_new"></a>
|
|
361
|
+
|
|
362
|
+
### new PointerEventService([typeArg], [init])
|
|
363
|
+
|
|
364
|
+
| Param | Type | Default | Description |
|
|
365
|
+
| --- | --- | --- | --- |
|
|
366
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
367
|
+
| [init] | <code>PointerEventInit</code> | <code>{}</code> | The options for the event |
|
|
368
|
+
|
|
369
|
+
<a name="EventService+inner"></a>
|
|
370
|
+
|
|
371
|
+
### pointerEventService.inner ⇒ <code>EventInner</code>
|
|
372
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
373
|
+
|
|
374
|
+
**Kind**: instance property of [<code>PointerEventService</code>](#PointerEventService)
|
|
375
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
376
|
+
<a name="MouseEventService+getModifierState"></a>
|
|
377
|
+
|
|
378
|
+
### pointerEventService.getModifierState(key) ⇒ <code>boolean</code>
|
|
379
|
+
Whether a modifier key was held down when the event happened.
|
|
380
|
+
|
|
381
|
+
**Kind**: instance method of [<code>PointerEventService</code>](#PointerEventService)
|
|
382
|
+
**Overrides**: [<code>getModifierState</code>](#MouseEventService+getModifierState)
|
|
383
|
+
|
|
384
|
+
| Param | Type | Description |
|
|
385
|
+
| --- | --- | --- |
|
|
386
|
+
| key | <code>string</code> | Control, Shift, Alt or Meta |
|
|
387
|
+
|
|
388
|
+
<a name="EventService+composedPath"></a>
|
|
389
|
+
|
|
390
|
+
### pointerEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
391
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
392
|
+
|
|
393
|
+
**Kind**: instance method of [<code>PointerEventService</code>](#PointerEventService)
|
|
394
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
395
|
+
<a name="EventService+preventDefault"></a>
|
|
396
|
+
|
|
397
|
+
### pointerEventService.preventDefault() ⇒ <code>null</code>
|
|
398
|
+
Cancels the event (if it is cancelable).
|
|
399
|
+
|
|
400
|
+
**Kind**: instance method of [<code>PointerEventService</code>](#PointerEventService)
|
|
401
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
402
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
403
|
+
|
|
404
|
+
### pointerEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
405
|
+
For this particular event, no other listener will be called.
|
|
406
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
407
|
+
capture phase, for instance)
|
|
408
|
+
|
|
409
|
+
**Kind**: instance method of [<code>PointerEventService</code>](#PointerEventService)
|
|
410
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
411
|
+
<a name="EventService+stopPropagation"></a>
|
|
412
|
+
|
|
413
|
+
### pointerEventService.stopPropagation() ⇒ <code>null</code>
|
|
414
|
+
Stops the propagation of events further along in the Dom.
|
|
415
|
+
|
|
416
|
+
**Kind**: instance method of [<code>PointerEventService</code>](#PointerEventService)
|
|
417
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
123
418
|
<a name="NodeService"></a>
|
|
124
419
|
|
|
125
420
|
## NodeService ⇐ <code>PseudoEventTarget</code>
|
|
@@ -138,16 +433,26 @@ Simulate the behaviour of the Node Class when there is no DOM available.
|
|
|
138
433
|
|
|
139
434
|
|
|
140
435
|
* [NodeService](#NodeService) ⇐ <code>PseudoEventTarget</code>
|
|
436
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
141
437
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
438
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
439
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
142
440
|
* [.childInserted(child)](#NodeService+childInserted)
|
|
143
|
-
* [.cloneNode()](#NodeService+cloneNode)
|
|
144
|
-
* [.compareDocumentPosition()](#NodeService+compareDocumentPosition)
|
|
441
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
442
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
145
443
|
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
146
444
|
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
147
|
-
* [.isEqualNode()](#NodeService+isEqualNode)
|
|
445
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
446
|
+
* [.normalize()](#NodeService+normalize)
|
|
148
447
|
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
149
448
|
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
150
449
|
|
|
450
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
451
|
+
|
|
452
|
+
### nodeService.acceptsChildren ⇒ <code>boolean</code>
|
|
453
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
454
|
+
|
|
455
|
+
**Kind**: instance property of [<code>NodeService</code>](#NodeService)
|
|
151
456
|
<a name="NodeService+appendChild"></a>
|
|
152
457
|
|
|
153
458
|
### nodeService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -160,6 +465,25 @@ Add a node as the last child of this node (a node which is already in a tree is
|
|
|
160
465
|
| --- | --- | --- |
|
|
161
466
|
| childNode | <code>PseudoNode</code> | The node to add |
|
|
162
467
|
|
|
468
|
+
<a name="NodeService+cloneShallow"></a>
|
|
469
|
+
|
|
470
|
+
### nodeService.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
471
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
472
|
+
Kinds of node which are made with arguments override this to give them.
|
|
473
|
+
|
|
474
|
+
**Kind**: instance method of [<code>NodeService</code>](#NodeService)
|
|
475
|
+
<a name="NodeService+equalsShallow"></a>
|
|
476
|
+
|
|
477
|
+
### nodeService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
478
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
479
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
480
|
+
|
|
481
|
+
**Kind**: instance method of [<code>NodeService</code>](#NodeService)
|
|
482
|
+
|
|
483
|
+
| Param | Type | Description |
|
|
484
|
+
| --- | --- | --- |
|
|
485
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
486
|
+
|
|
163
487
|
<a name="NodeService+childInserted"></a>
|
|
164
488
|
|
|
165
489
|
### nodeService.childInserted(child)
|
|
@@ -174,23 +498,29 @@ Called each time a node has been inserted as a child of this node, so that nodes
|
|
|
174
498
|
|
|
175
499
|
<a name="NodeService+cloneNode"></a>
|
|
176
500
|
|
|
177
|
-
### nodeService.cloneNode()
|
|
178
|
-
|
|
501
|
+
### nodeService.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
502
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
503
|
+
too, all the way down.
|
|
179
504
|
|
|
180
505
|
**Kind**: instance method of [<code>NodeService</code>](#NodeService)
|
|
181
|
-
**Throws**:
|
|
182
506
|
|
|
183
|
-
|
|
507
|
+
| Param | Type | Default | Description |
|
|
508
|
+
| --- | --- | --- | --- |
|
|
509
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
184
510
|
|
|
185
511
|
<a name="NodeService+compareDocumentPosition"></a>
|
|
186
512
|
|
|
187
|
-
### nodeService.compareDocumentPosition()
|
|
188
|
-
|
|
513
|
+
### nodeService.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
514
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
515
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
516
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
517
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
189
518
|
|
|
190
519
|
**Kind**: instance method of [<code>NodeService</code>](#NodeService)
|
|
191
|
-
**Throws**:
|
|
192
520
|
|
|
193
|
-
|
|
521
|
+
| Param | Type | Description |
|
|
522
|
+
| --- | --- | --- |
|
|
523
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
194
524
|
|
|
195
525
|
<a name="NodeService+contains"></a>
|
|
196
526
|
|
|
@@ -223,14 +553,22 @@ already in a tree is moved, and the children of a document fragment are moved in
|
|
|
223
553
|
|
|
224
554
|
<a name="NodeService+isEqualNode"></a>
|
|
225
555
|
|
|
226
|
-
### nodeService.isEqualNode()
|
|
227
|
-
|
|
556
|
+
### nodeService.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
557
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
558
|
+
needs the same attributes), and children which are equal in the same order.
|
|
228
559
|
|
|
229
560
|
**Kind**: instance method of [<code>NodeService</code>](#NodeService)
|
|
230
|
-
**Throws**:
|
|
231
561
|
|
|
232
|
-
|
|
562
|
+
| Param | Type | Description |
|
|
563
|
+
| --- | --- | --- |
|
|
564
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
565
|
+
|
|
566
|
+
<a name="NodeService+normalize"></a>
|
|
233
567
|
|
|
568
|
+
### nodeService.normalize()
|
|
569
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
570
|
+
|
|
571
|
+
**Kind**: instance method of [<code>NodeService</code>](#NodeService)
|
|
234
572
|
<a name="NodeService+removeChild"></a>
|
|
235
573
|
|
|
236
574
|
### nodeService.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
@@ -264,55 +602,837 @@ Replace a child of this node with another node (which is moved if it is already
|
|
|
264
602
|
| newChild | <code>PseudoNode</code> | The node which takes the place |
|
|
265
603
|
| oldChild | <code>PseudoNode</code> | The child of this node to replace |
|
|
266
604
|
|
|
267
|
-
<a name="
|
|
605
|
+
<a name="TextService"></a>
|
|
268
606
|
|
|
269
|
-
##
|
|
270
|
-
Simulate the behaviour of the
|
|
607
|
+
## TextService ⇐ [<code>NodeService</code>](#NodeService)
|
|
608
|
+
Simulate the behaviour of the Text Class when there is no DOM available: the text in an element.
|
|
271
609
|
|
|
272
610
|
**Kind**: global class
|
|
611
|
+
**Extends**: [<code>NodeService</code>](#NodeService)
|
|
273
612
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
274
|
-
|
|
613
|
+
**Properties**
|
|
275
614
|
|
|
276
|
-
|
|
615
|
+
| Name | Type | Description |
|
|
616
|
+
| --- | --- | --- |
|
|
617
|
+
| data | <code>string</code> | The text |
|
|
618
|
+
| length | <code>number</code> | How many characters there are |
|
|
619
|
+
| wholeText | <code>string</code> | The text of this node and of the text nodes next to it |
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
* [TextService](#TextService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
623
|
+
* [new TextService([data])](#new_TextService_new)
|
|
624
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
625
|
+
* [.splitText(offset)](#TextService+splitText) ⇒ [<code>TextService</code>](#TextService)
|
|
626
|
+
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
627
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
628
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
629
|
+
* [.childInserted(child)](#NodeService+childInserted)
|
|
630
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
631
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
632
|
+
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
633
|
+
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
634
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
635
|
+
* [.normalize()](#NodeService+normalize)
|
|
636
|
+
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
637
|
+
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
638
|
+
|
|
639
|
+
<a name="new_TextService_new"></a>
|
|
640
|
+
|
|
641
|
+
### new TextService([data])
|
|
642
|
+
|
|
643
|
+
| Param | Type | Default | Description |
|
|
644
|
+
| --- | --- | --- | --- |
|
|
645
|
+
| [data] | <code>string</code> | <code>"''"</code> | The text |
|
|
646
|
+
|
|
647
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
648
|
+
|
|
649
|
+
### textService.acceptsChildren ⇒ <code>boolean</code>
|
|
650
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
651
|
+
|
|
652
|
+
**Kind**: instance property of [<code>TextService</code>](#TextService)
|
|
653
|
+
**Overrides**: [<code>acceptsChildren</code>](#NodeService+acceptsChildren)
|
|
654
|
+
<a name="TextService+splitText"></a>
|
|
655
|
+
|
|
656
|
+
### textService.splitText(offset) ⇒ [<code>TextService</code>](#TextService)
|
|
657
|
+
Break this text node in two at a position: this node keeps the text before it and a new node with the rest is put
|
|
658
|
+
after this one.
|
|
659
|
+
|
|
660
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
661
|
+
**Returns**: [<code>TextService</code>](#TextService) - The new node
|
|
662
|
+
**Throws**:
|
|
663
|
+
|
|
664
|
+
- <code>Error</code> When the offset is beyond the end of the text
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
| Param | Type | Description |
|
|
668
|
+
| --- | --- | --- |
|
|
669
|
+
| offset | <code>number</code> | How many characters stay in this node |
|
|
670
|
+
|
|
671
|
+
<a name="NodeService+appendChild"></a>
|
|
672
|
+
|
|
673
|
+
### textService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
674
|
+
Add a node as the last child of this node (a node which is already in a tree is moved).
|
|
675
|
+
|
|
676
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
677
|
+
**Overrides**: [<code>appendChild</code>](#NodeService+appendChild)
|
|
678
|
+
**Returns**: <code>PseudoNode</code> - The added node
|
|
679
|
+
|
|
680
|
+
| Param | Type | Description |
|
|
681
|
+
| --- | --- | --- |
|
|
682
|
+
| childNode | <code>PseudoNode</code> | The node to add |
|
|
683
|
+
|
|
684
|
+
<a name="NodeService+cloneShallow"></a>
|
|
685
|
+
|
|
686
|
+
### textService.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
687
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
688
|
+
Kinds of node which are made with arguments override this to give them.
|
|
689
|
+
|
|
690
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
691
|
+
**Overrides**: [<code>cloneShallow</code>](#NodeService+cloneShallow)
|
|
692
|
+
<a name="NodeService+equalsShallow"></a>
|
|
693
|
+
|
|
694
|
+
### textService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
695
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
696
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
697
|
+
|
|
698
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
699
|
+
**Overrides**: [<code>equalsShallow</code>](#NodeService+equalsShallow)
|
|
700
|
+
|
|
701
|
+
| Param | Type | Description |
|
|
702
|
+
| --- | --- | --- |
|
|
703
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
704
|
+
|
|
705
|
+
<a name="NodeService+childInserted"></a>
|
|
706
|
+
|
|
707
|
+
### textService.childInserted(child)
|
|
708
|
+
Called each time a node has been inserted as a child of this node, so that nodes which need to react to children
|
|
709
|
+
(for example elements applying default events) can do so.
|
|
710
|
+
|
|
711
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
712
|
+
**Overrides**: [<code>childInserted</code>](#NodeService+childInserted)
|
|
713
|
+
|
|
714
|
+
| Param | Type | Description |
|
|
715
|
+
| --- | --- | --- |
|
|
716
|
+
| child | [<code>NodeService</code>](#NodeService) | The node which was inserted |
|
|
717
|
+
|
|
718
|
+
<a name="NodeService+cloneNode"></a>
|
|
719
|
+
|
|
720
|
+
### textService.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
721
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
722
|
+
too, all the way down.
|
|
723
|
+
|
|
724
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
725
|
+
**Overrides**: [<code>cloneNode</code>](#NodeService+cloneNode)
|
|
726
|
+
|
|
727
|
+
| Param | Type | Default | Description |
|
|
728
|
+
| --- | --- | --- | --- |
|
|
729
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
730
|
+
|
|
731
|
+
<a name="NodeService+compareDocumentPosition"></a>
|
|
732
|
+
|
|
733
|
+
### textService.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
734
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
735
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
736
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
737
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
738
|
+
|
|
739
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
740
|
+
**Overrides**: [<code>compareDocumentPosition</code>](#NodeService+compareDocumentPosition)
|
|
741
|
+
|
|
742
|
+
| Param | Type | Description |
|
|
743
|
+
| --- | --- | --- |
|
|
744
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
745
|
+
|
|
746
|
+
<a name="NodeService+contains"></a>
|
|
747
|
+
|
|
748
|
+
### textService.contains(otherNode) ⇒ <code>boolean</code>
|
|
749
|
+
Check whether a node is this node or one of its descendants.
|
|
750
|
+
|
|
751
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
752
|
+
**Overrides**: [<code>contains</code>](#NodeService+contains)
|
|
753
|
+
|
|
754
|
+
| Param | Type | Description |
|
|
755
|
+
| --- | --- | --- |
|
|
756
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to look for |
|
|
757
|
+
|
|
758
|
+
<a name="NodeService+insertBefore"></a>
|
|
759
|
+
|
|
760
|
+
### textService.insertBefore(newNode, [referenceNode]) ⇒ <code>PseudoNode</code>
|
|
761
|
+
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
|
|
762
|
+
already in a tree is moved, and the children of a document fragment are moved in order.
|
|
763
|
+
|
|
764
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
765
|
+
**Overrides**: [<code>insertBefore</code>](#NodeService+insertBefore)
|
|
766
|
+
**Returns**: <code>PseudoNode</code> - The inserted node
|
|
767
|
+
**Throws**:
|
|
768
|
+
|
|
769
|
+
- <code>Error</code> When the reference node is not a child of this node, or the new node is this node or contains it
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
| Param | Type | Default | Description |
|
|
773
|
+
| --- | --- | --- | --- |
|
|
774
|
+
| newNode | <code>PseudoNode</code> | | The node to insert |
|
|
775
|
+
| [referenceNode] | <code>PseudoNode</code> \| <code>null</code> | <code></code> | The child of this node to insert before, or null to insert at the end |
|
|
776
|
+
|
|
777
|
+
<a name="NodeService+isEqualNode"></a>
|
|
778
|
+
|
|
779
|
+
### textService.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
780
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
781
|
+
needs the same attributes), and children which are equal in the same order.
|
|
782
|
+
|
|
783
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
784
|
+
**Overrides**: [<code>isEqualNode</code>](#NodeService+isEqualNode)
|
|
785
|
+
|
|
786
|
+
| Param | Type | Description |
|
|
787
|
+
| --- | --- | --- |
|
|
788
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
789
|
+
|
|
790
|
+
<a name="NodeService+normalize"></a>
|
|
791
|
+
|
|
792
|
+
### textService.normalize()
|
|
793
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
794
|
+
|
|
795
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
796
|
+
**Overrides**: [<code>normalize</code>](#NodeService+normalize)
|
|
797
|
+
<a name="NodeService+removeChild"></a>
|
|
798
|
+
|
|
799
|
+
### textService.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
800
|
+
Remove a child from this node, it no longer has a parent or siblings afterwards.
|
|
801
|
+
|
|
802
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
803
|
+
**Overrides**: [<code>removeChild</code>](#NodeService+removeChild)
|
|
804
|
+
**Returns**: <code>PseudoNode</code> - The removed node
|
|
805
|
+
**Throws**:
|
|
806
|
+
|
|
807
|
+
- <code>Error</code> When the node is not a child of this node
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
| Param | Type | Description |
|
|
811
|
+
| --- | --- | --- |
|
|
812
|
+
| childElement | <code>PseudoNode</code> | The child node to remove |
|
|
813
|
+
|
|
814
|
+
<a name="NodeService+replaceChild"></a>
|
|
815
|
+
|
|
816
|
+
### textService.replaceChild(newChild, oldChild) ⇒ <code>PseudoNode</code>
|
|
817
|
+
Replace a child of this node with another node (which is moved if it is already in a tree).
|
|
818
|
+
|
|
819
|
+
**Kind**: instance method of [<code>TextService</code>](#TextService)
|
|
820
|
+
**Overrides**: [<code>replaceChild</code>](#NodeService+replaceChild)
|
|
821
|
+
**Returns**: <code>PseudoNode</code> - The replaced node
|
|
822
|
+
**Throws**:
|
|
823
|
+
|
|
824
|
+
- <code>Error</code> When the old node is not a child of this node
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
| Param | Type | Description |
|
|
828
|
+
| --- | --- | --- |
|
|
829
|
+
| newChild | <code>PseudoNode</code> | The node which takes the place |
|
|
830
|
+
| oldChild | <code>PseudoNode</code> | The child of this node to replace |
|
|
831
|
+
|
|
832
|
+
<a name="CommentService"></a>
|
|
833
|
+
|
|
834
|
+
## CommentService ⇐ [<code>NodeService</code>](#NodeService)
|
|
835
|
+
Simulate the behaviour of the Comment Class when there is no DOM available: a note in the markup which is not shown.
|
|
836
|
+
|
|
837
|
+
**Kind**: global class
|
|
838
|
+
**Extends**: [<code>NodeService</code>](#NodeService)
|
|
839
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
840
|
+
**Properties**
|
|
841
|
+
|
|
842
|
+
| Name | Type | Description |
|
|
843
|
+
| --- | --- | --- |
|
|
844
|
+
| data | <code>string</code> | The comment |
|
|
845
|
+
| length | <code>number</code> | How many characters there are |
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
* [CommentService](#CommentService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
849
|
+
* [new CommentService([data])](#new_CommentService_new)
|
|
850
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
851
|
+
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
852
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
853
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
854
|
+
* [.childInserted(child)](#NodeService+childInserted)
|
|
855
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
856
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
857
|
+
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
858
|
+
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
859
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
860
|
+
* [.normalize()](#NodeService+normalize)
|
|
861
|
+
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
862
|
+
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
863
|
+
|
|
864
|
+
<a name="new_CommentService_new"></a>
|
|
865
|
+
|
|
866
|
+
### new CommentService([data])
|
|
867
|
+
|
|
868
|
+
| Param | Type | Default | Description |
|
|
869
|
+
| --- | --- | --- | --- |
|
|
870
|
+
| [data] | <code>string</code> | <code>"''"</code> | The comment |
|
|
871
|
+
|
|
872
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
873
|
+
|
|
874
|
+
### commentService.acceptsChildren ⇒ <code>boolean</code>
|
|
875
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
876
|
+
|
|
877
|
+
**Kind**: instance property of [<code>CommentService</code>](#CommentService)
|
|
878
|
+
**Overrides**: [<code>acceptsChildren</code>](#NodeService+acceptsChildren)
|
|
879
|
+
<a name="NodeService+appendChild"></a>
|
|
880
|
+
|
|
881
|
+
### commentService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
882
|
+
Add a node as the last child of this node (a node which is already in a tree is moved).
|
|
883
|
+
|
|
884
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
885
|
+
**Overrides**: [<code>appendChild</code>](#NodeService+appendChild)
|
|
886
|
+
**Returns**: <code>PseudoNode</code> - The added node
|
|
887
|
+
|
|
888
|
+
| Param | Type | Description |
|
|
889
|
+
| --- | --- | --- |
|
|
890
|
+
| childNode | <code>PseudoNode</code> | The node to add |
|
|
891
|
+
|
|
892
|
+
<a name="NodeService+cloneShallow"></a>
|
|
893
|
+
|
|
894
|
+
### commentService.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
895
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
896
|
+
Kinds of node which are made with arguments override this to give them.
|
|
897
|
+
|
|
898
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
899
|
+
**Overrides**: [<code>cloneShallow</code>](#NodeService+cloneShallow)
|
|
900
|
+
<a name="NodeService+equalsShallow"></a>
|
|
901
|
+
|
|
902
|
+
### commentService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
903
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
904
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
905
|
+
|
|
906
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
907
|
+
**Overrides**: [<code>equalsShallow</code>](#NodeService+equalsShallow)
|
|
908
|
+
|
|
909
|
+
| Param | Type | Description |
|
|
910
|
+
| --- | --- | --- |
|
|
911
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
912
|
+
|
|
913
|
+
<a name="NodeService+childInserted"></a>
|
|
914
|
+
|
|
915
|
+
### commentService.childInserted(child)
|
|
916
|
+
Called each time a node has been inserted as a child of this node, so that nodes which need to react to children
|
|
917
|
+
(for example elements applying default events) can do so.
|
|
918
|
+
|
|
919
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
920
|
+
**Overrides**: [<code>childInserted</code>](#NodeService+childInserted)
|
|
921
|
+
|
|
922
|
+
| Param | Type | Description |
|
|
923
|
+
| --- | --- | --- |
|
|
924
|
+
| child | [<code>NodeService</code>](#NodeService) | The node which was inserted |
|
|
925
|
+
|
|
926
|
+
<a name="NodeService+cloneNode"></a>
|
|
927
|
+
|
|
928
|
+
### commentService.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
929
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
930
|
+
too, all the way down.
|
|
931
|
+
|
|
932
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
933
|
+
**Overrides**: [<code>cloneNode</code>](#NodeService+cloneNode)
|
|
934
|
+
|
|
935
|
+
| Param | Type | Default | Description |
|
|
936
|
+
| --- | --- | --- | --- |
|
|
937
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
938
|
+
|
|
939
|
+
<a name="NodeService+compareDocumentPosition"></a>
|
|
940
|
+
|
|
941
|
+
### commentService.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
942
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
943
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
944
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
945
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
946
|
+
|
|
947
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
948
|
+
**Overrides**: [<code>compareDocumentPosition</code>](#NodeService+compareDocumentPosition)
|
|
949
|
+
|
|
950
|
+
| Param | Type | Description |
|
|
951
|
+
| --- | --- | --- |
|
|
952
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
953
|
+
|
|
954
|
+
<a name="NodeService+contains"></a>
|
|
955
|
+
|
|
956
|
+
### commentService.contains(otherNode) ⇒ <code>boolean</code>
|
|
957
|
+
Check whether a node is this node or one of its descendants.
|
|
958
|
+
|
|
959
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
960
|
+
**Overrides**: [<code>contains</code>](#NodeService+contains)
|
|
961
|
+
|
|
962
|
+
| Param | Type | Description |
|
|
963
|
+
| --- | --- | --- |
|
|
964
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to look for |
|
|
965
|
+
|
|
966
|
+
<a name="NodeService+insertBefore"></a>
|
|
967
|
+
|
|
968
|
+
### commentService.insertBefore(newNode, [referenceNode]) ⇒ <code>PseudoNode</code>
|
|
969
|
+
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
|
|
970
|
+
already in a tree is moved, and the children of a document fragment are moved in order.
|
|
971
|
+
|
|
972
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
973
|
+
**Overrides**: [<code>insertBefore</code>](#NodeService+insertBefore)
|
|
974
|
+
**Returns**: <code>PseudoNode</code> - The inserted node
|
|
975
|
+
**Throws**:
|
|
976
|
+
|
|
977
|
+
- <code>Error</code> When the reference node is not a child of this node, or the new node is this node or contains it
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
| Param | Type | Default | Description |
|
|
981
|
+
| --- | --- | --- | --- |
|
|
982
|
+
| newNode | <code>PseudoNode</code> | | The node to insert |
|
|
983
|
+
| [referenceNode] | <code>PseudoNode</code> \| <code>null</code> | <code></code> | The child of this node to insert before, or null to insert at the end |
|
|
984
|
+
|
|
985
|
+
<a name="NodeService+isEqualNode"></a>
|
|
986
|
+
|
|
987
|
+
### commentService.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
988
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
989
|
+
needs the same attributes), and children which are equal in the same order.
|
|
990
|
+
|
|
991
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
992
|
+
**Overrides**: [<code>isEqualNode</code>](#NodeService+isEqualNode)
|
|
993
|
+
|
|
994
|
+
| Param | Type | Description |
|
|
995
|
+
| --- | --- | --- |
|
|
996
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
997
|
+
|
|
998
|
+
<a name="NodeService+normalize"></a>
|
|
999
|
+
|
|
1000
|
+
### commentService.normalize()
|
|
1001
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
1002
|
+
|
|
1003
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
1004
|
+
**Overrides**: [<code>normalize</code>](#NodeService+normalize)
|
|
1005
|
+
<a name="NodeService+removeChild"></a>
|
|
1006
|
+
|
|
1007
|
+
### commentService.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
1008
|
+
Remove a child from this node, it no longer has a parent or siblings afterwards.
|
|
1009
|
+
|
|
1010
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
1011
|
+
**Overrides**: [<code>removeChild</code>](#NodeService+removeChild)
|
|
1012
|
+
**Returns**: <code>PseudoNode</code> - The removed node
|
|
1013
|
+
**Throws**:
|
|
1014
|
+
|
|
1015
|
+
- <code>Error</code> When the node is not a child of this node
|
|
1016
|
+
|
|
1017
|
+
|
|
1018
|
+
| Param | Type | Description |
|
|
1019
|
+
| --- | --- | --- |
|
|
1020
|
+
| childElement | <code>PseudoNode</code> | The child node to remove |
|
|
1021
|
+
|
|
1022
|
+
<a name="NodeService+replaceChild"></a>
|
|
1023
|
+
|
|
1024
|
+
### commentService.replaceChild(newChild, oldChild) ⇒ <code>PseudoNode</code>
|
|
1025
|
+
Replace a child of this node with another node (which is moved if it is already in a tree).
|
|
1026
|
+
|
|
1027
|
+
**Kind**: instance method of [<code>CommentService</code>](#CommentService)
|
|
1028
|
+
**Overrides**: [<code>replaceChild</code>](#NodeService+replaceChild)
|
|
1029
|
+
**Returns**: <code>PseudoNode</code> - The replaced node
|
|
1030
|
+
**Throws**:
|
|
1031
|
+
|
|
1032
|
+
- <code>Error</code> When the old node is not a child of this node
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
| Param | Type | Description |
|
|
1036
|
+
| --- | --- | --- |
|
|
1037
|
+
| newChild | <code>PseudoNode</code> | The node which takes the place |
|
|
1038
|
+
| oldChild | <code>PseudoNode</code> | The child of this node to replace |
|
|
1039
|
+
|
|
1040
|
+
<a name="NamedNodeMapService"></a>
|
|
1041
|
+
|
|
1042
|
+
## NamedNodeMapService
|
|
1043
|
+
Simulate the behaviour of the NamedNodeMap Class when there is no DOM available.
|
|
1044
|
+
|
|
1045
|
+
**Kind**: global class
|
|
1046
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1047
|
+
<a name="new_NamedNodeMapService_new"></a>
|
|
1048
|
+
|
|
1049
|
+
### new NamedNodeMapService([attributes])
|
|
1050
|
+
|
|
1051
|
+
| Param | Type | Default | Description |
|
|
1052
|
+
| --- | --- | --- | --- |
|
|
1053
|
+
| [attributes] | <code>Array.<PseudoAttr></code> | <code>[]</code> | The attributes to start with |
|
|
1054
|
+
|
|
1055
|
+
<a name="MouseEventService"></a>
|
|
1056
|
+
|
|
1057
|
+
## MouseEventService ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1058
|
+
Simulate the behaviour of the MouseEvent Class when there is no DOM available.
|
|
1059
|
+
|
|
1060
|
+
**Kind**: global class
|
|
1061
|
+
**Extends**: [<code>UIEventService</code>](#UIEventService)
|
|
1062
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1063
|
+
**Properties**
|
|
1064
|
+
|
|
1065
|
+
| Name | Type |
|
|
1066
|
+
| --- | --- |
|
|
1067
|
+
| screenX | <code>number</code> |
|
|
1068
|
+
| screenY | <code>number</code> |
|
|
1069
|
+
| clientX | <code>number</code> |
|
|
1070
|
+
| clientY | <code>number</code> |
|
|
1071
|
+
| button | <code>number</code> |
|
|
1072
|
+
| buttons | <code>number</code> |
|
|
1073
|
+
| relatedTarget | <code>PseudoEventTarget</code> \| <code>null</code> |
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
* [MouseEventService](#MouseEventService) ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1077
|
+
* [new MouseEventService([typeArg], [init])](#new_MouseEventService_new)
|
|
1078
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
1079
|
+
* [.getModifierState(key)](#MouseEventService+getModifierState) ⇒ <code>boolean</code>
|
|
1080
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1081
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
1082
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
1083
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
1084
|
+
|
|
1085
|
+
<a name="new_MouseEventService_new"></a>
|
|
1086
|
+
|
|
1087
|
+
### new MouseEventService([typeArg], [init])
|
|
1088
|
+
|
|
1089
|
+
| Param | Type | Default | Description |
|
|
1090
|
+
| --- | --- | --- | --- |
|
|
1091
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
1092
|
+
| [init] | <code>MouseEventInit</code> | <code>{}</code> | The options for the event |
|
|
1093
|
+
|
|
1094
|
+
<a name="EventService+inner"></a>
|
|
1095
|
+
|
|
1096
|
+
### mouseEventService.inner ⇒ <code>EventInner</code>
|
|
1097
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
1098
|
+
|
|
1099
|
+
**Kind**: instance property of [<code>MouseEventService</code>](#MouseEventService)
|
|
1100
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
1101
|
+
<a name="MouseEventService+getModifierState"></a>
|
|
1102
|
+
|
|
1103
|
+
### mouseEventService.getModifierState(key) ⇒ <code>boolean</code>
|
|
1104
|
+
Whether a modifier key was held down when the event happened.
|
|
1105
|
+
|
|
1106
|
+
**Kind**: instance method of [<code>MouseEventService</code>](#MouseEventService)
|
|
1107
|
+
|
|
1108
|
+
| Param | Type | Description |
|
|
1109
|
+
| --- | --- | --- |
|
|
1110
|
+
| key | <code>string</code> | Control, Shift, Alt or Meta |
|
|
1111
|
+
|
|
1112
|
+
<a name="EventService+composedPath"></a>
|
|
1113
|
+
|
|
1114
|
+
### mouseEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1115
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
1116
|
+
|
|
1117
|
+
**Kind**: instance method of [<code>MouseEventService</code>](#MouseEventService)
|
|
1118
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
1119
|
+
<a name="EventService+preventDefault"></a>
|
|
1120
|
+
|
|
1121
|
+
### mouseEventService.preventDefault() ⇒ <code>null</code>
|
|
1122
|
+
Cancels the event (if it is cancelable).
|
|
1123
|
+
|
|
1124
|
+
**Kind**: instance method of [<code>MouseEventService</code>](#MouseEventService)
|
|
1125
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
1126
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
1127
|
+
|
|
1128
|
+
### mouseEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
1129
|
+
For this particular event, no other listener will be called.
|
|
1130
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
1131
|
+
capture phase, for instance)
|
|
1132
|
+
|
|
1133
|
+
**Kind**: instance method of [<code>MouseEventService</code>](#MouseEventService)
|
|
1134
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
1135
|
+
<a name="EventService+stopPropagation"></a>
|
|
1136
|
+
|
|
1137
|
+
### mouseEventService.stopPropagation() ⇒ <code>null</code>
|
|
1138
|
+
Stops the propagation of events further along in the Dom.
|
|
1139
|
+
|
|
1140
|
+
**Kind**: instance method of [<code>MouseEventService</code>](#MouseEventService)
|
|
1141
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
1142
|
+
<a name="KeyboardEventService"></a>
|
|
1143
|
+
|
|
1144
|
+
## KeyboardEventService ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1145
|
+
Simulate the behaviour of the KeyboardEvent Class when there is no DOM available.
|
|
1146
|
+
|
|
1147
|
+
**Kind**: global class
|
|
1148
|
+
**Extends**: [<code>UIEventService</code>](#UIEventService)
|
|
1149
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1150
|
+
**Properties**
|
|
1151
|
+
|
|
1152
|
+
| Name | Type |
|
|
1153
|
+
| --- | --- |
|
|
1154
|
+
| key | <code>string</code> |
|
|
1155
|
+
| code | <code>string</code> |
|
|
1156
|
+
| location | <code>number</code> |
|
|
1157
|
+
| repeat | <code>boolean</code> |
|
|
1158
|
+
| isComposing | <code>boolean</code> |
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
* [KeyboardEventService](#KeyboardEventService) ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1162
|
+
* [new KeyboardEventService([typeArg], [init])](#new_KeyboardEventService_new)
|
|
1163
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
1164
|
+
* [.getModifierState(key)](#KeyboardEventService+getModifierState) ⇒ <code>boolean</code>
|
|
1165
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1166
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
1167
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
1168
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
1169
|
+
|
|
1170
|
+
<a name="new_KeyboardEventService_new"></a>
|
|
1171
|
+
|
|
1172
|
+
### new KeyboardEventService([typeArg], [init])
|
|
1173
|
+
|
|
1174
|
+
| Param | Type | Default | Description |
|
|
1175
|
+
| --- | --- | --- | --- |
|
|
1176
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
1177
|
+
| [init] | <code>KeyboardEventInit</code> | <code>{}</code> | The options for the event |
|
|
1178
|
+
|
|
1179
|
+
<a name="EventService+inner"></a>
|
|
1180
|
+
|
|
1181
|
+
### keyboardEventService.inner ⇒ <code>EventInner</code>
|
|
1182
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
1183
|
+
|
|
1184
|
+
**Kind**: instance property of [<code>KeyboardEventService</code>](#KeyboardEventService)
|
|
1185
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
1186
|
+
<a name="KeyboardEventService+getModifierState"></a>
|
|
1187
|
+
|
|
1188
|
+
### keyboardEventService.getModifierState(key) ⇒ <code>boolean</code>
|
|
1189
|
+
Whether a modifier key was held down when the event happened.
|
|
1190
|
+
|
|
1191
|
+
**Kind**: instance method of [<code>KeyboardEventService</code>](#KeyboardEventService)
|
|
1192
|
+
|
|
1193
|
+
| Param | Type | Description |
|
|
1194
|
+
| --- | --- | --- |
|
|
1195
|
+
| key | <code>string</code> | Control, Shift, Alt or Meta |
|
|
1196
|
+
|
|
1197
|
+
<a name="EventService+composedPath"></a>
|
|
1198
|
+
|
|
1199
|
+
### keyboardEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1200
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
1201
|
+
|
|
1202
|
+
**Kind**: instance method of [<code>KeyboardEventService</code>](#KeyboardEventService)
|
|
1203
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
1204
|
+
<a name="EventService+preventDefault"></a>
|
|
1205
|
+
|
|
1206
|
+
### keyboardEventService.preventDefault() ⇒ <code>null</code>
|
|
1207
|
+
Cancels the event (if it is cancelable).
|
|
1208
|
+
|
|
1209
|
+
**Kind**: instance method of [<code>KeyboardEventService</code>](#KeyboardEventService)
|
|
1210
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
1211
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
1212
|
+
|
|
1213
|
+
### keyboardEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
1214
|
+
For this particular event, no other listener will be called.
|
|
1215
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
1216
|
+
capture phase, for instance)
|
|
1217
|
+
|
|
1218
|
+
**Kind**: instance method of [<code>KeyboardEventService</code>](#KeyboardEventService)
|
|
1219
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
1220
|
+
<a name="EventService+stopPropagation"></a>
|
|
1221
|
+
|
|
1222
|
+
### keyboardEventService.stopPropagation() ⇒ <code>null</code>
|
|
1223
|
+
Stops the propagation of events further along in the Dom.
|
|
1224
|
+
|
|
1225
|
+
**Kind**: instance method of [<code>KeyboardEventService</code>](#KeyboardEventService)
|
|
1226
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
1227
|
+
<a name="InputEventService"></a>
|
|
1228
|
+
|
|
1229
|
+
## InputEventService ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1230
|
+
Simulate the behaviour of the InputEvent Class when there is no DOM available.
|
|
1231
|
+
|
|
1232
|
+
**Kind**: global class
|
|
1233
|
+
**Extends**: [<code>UIEventService</code>](#UIEventService)
|
|
1234
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1235
|
+
**Properties**
|
|
1236
|
+
|
|
1237
|
+
| Name | Type |
|
|
1238
|
+
| --- | --- |
|
|
1239
|
+
| data | <code>string</code> \| <code>null</code> |
|
|
1240
|
+
| inputType | <code>string</code> |
|
|
1241
|
+
| isComposing | <code>boolean</code> |
|
|
1242
|
+
|
|
1243
|
+
|
|
1244
|
+
* [InputEventService](#InputEventService) ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1245
|
+
* [new InputEventService([typeArg], [init])](#new_InputEventService_new)
|
|
1246
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
1247
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1248
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
1249
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
1250
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
1251
|
+
|
|
1252
|
+
<a name="new_InputEventService_new"></a>
|
|
1253
|
+
|
|
1254
|
+
### new InputEventService([typeArg], [init])
|
|
1255
|
+
|
|
1256
|
+
| Param | Type | Default | Description |
|
|
1257
|
+
| --- | --- | --- | --- |
|
|
1258
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
1259
|
+
| [init] | <code>InputEventInit</code> | <code>{}</code> | The options for the event |
|
|
1260
|
+
|
|
1261
|
+
<a name="EventService+inner"></a>
|
|
1262
|
+
|
|
1263
|
+
### inputEventService.inner ⇒ <code>EventInner</code>
|
|
1264
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
1265
|
+
|
|
1266
|
+
**Kind**: instance property of [<code>InputEventService</code>](#InputEventService)
|
|
1267
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
1268
|
+
<a name="EventService+composedPath"></a>
|
|
1269
|
+
|
|
1270
|
+
### inputEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1271
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
1272
|
+
|
|
1273
|
+
**Kind**: instance method of [<code>InputEventService</code>](#InputEventService)
|
|
1274
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
1275
|
+
<a name="EventService+preventDefault"></a>
|
|
1276
|
+
|
|
1277
|
+
### inputEventService.preventDefault() ⇒ <code>null</code>
|
|
1278
|
+
Cancels the event (if it is cancelable).
|
|
1279
|
+
|
|
1280
|
+
**Kind**: instance method of [<code>InputEventService</code>](#InputEventService)
|
|
1281
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
1282
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
1283
|
+
|
|
1284
|
+
### inputEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
1285
|
+
For this particular event, no other listener will be called.
|
|
1286
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
1287
|
+
capture phase, for instance)
|
|
1288
|
+
|
|
1289
|
+
**Kind**: instance method of [<code>InputEventService</code>](#InputEventService)
|
|
1290
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
1291
|
+
<a name="EventService+stopPropagation"></a>
|
|
1292
|
+
|
|
1293
|
+
### inputEventService.stopPropagation() ⇒ <code>null</code>
|
|
1294
|
+
Stops the propagation of events further along in the Dom.
|
|
1295
|
+
|
|
1296
|
+
**Kind**: instance method of [<code>InputEventService</code>](#InputEventService)
|
|
1297
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
1298
|
+
<a name="HTMLElementService"></a>
|
|
1299
|
+
|
|
1300
|
+
## HTMLElementService ⇐ <code>PseudoElement</code>
|
|
1301
|
+
Simulate the behaviour of the HTMLElement Class when there is no DOM available.
|
|
1302
|
+
|
|
1303
|
+
**Kind**: global class
|
|
1304
|
+
**Extends**: <code>PseudoElement</code>
|
|
1305
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1306
|
+
**Properties**
|
|
1307
|
+
|
|
1308
|
+
| Name | Type | Description |
|
|
1309
|
+
| --- | --- | --- |
|
|
1310
|
+
| hidden | <code>boolean</code> | State of whether element is visible |
|
|
1311
|
+
| offsetHeight | <code>number</code> | The height of the element as offset by the parent element |
|
|
1312
|
+
| offsetLeft | <code>number</code> | The position of the left side of the element based on the parent element |
|
|
1313
|
+
| offsetParent | <code>PseudoHTMLElement</code> | A reference to the closest positioned parent element |
|
|
1314
|
+
| offsetTop | <code>number</code> | The position of the top side of the element based on the parent element |
|
|
1315
|
+
| offsetWidth | <code>number</code> | The width of the element as offset by the parent element |
|
|
1316
|
+
| style | <code>Object</code> | A container to define all applied inline-styles |
|
|
1317
|
+
| title | <code>string</code> | The title attribute which affects the text visible on hover |
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
* [HTMLElementService](#HTMLElementService) ⇐ <code>PseudoElement</code>
|
|
1321
|
+
* [new HTMLElementService([elementOptions])](#new_HTMLElementService_new)
|
|
1322
|
+
* [.canFocus](#HTMLElementService+canFocus) ⇒ <code>boolean</code>
|
|
1323
|
+
* [.click()](#HTMLElementService+click)
|
|
1324
|
+
* [.focus()](#HTMLElementService+focus)
|
|
1325
|
+
* [.blur()](#HTMLElementService+blur)
|
|
1326
|
+
|
|
1327
|
+
<a name="new_HTMLElementService_new"></a>
|
|
1328
|
+
|
|
1329
|
+
### new HTMLElementService([elementOptions])
|
|
1330
|
+
Simulate the HTMLElement object when the Dom is not available
|
|
1331
|
+
|
|
1332
|
+
|
|
1333
|
+
| Param | Type | Default |
|
|
1334
|
+
| --- | --- | --- |
|
|
1335
|
+
| [elementOptions] | <code>Object</code> | <code>{}</code> |
|
|
1336
|
+
| [elementOptions.tagName] | <code>string</code> | <code>"''"</code> |
|
|
1337
|
+
| [elementOptions.parent] | <code>PseudoNode</code> \| <code>Object</code> | <code>{}</code> |
|
|
1338
|
+
| [elementOptions.children] | <code>Array</code> | <code>[]</code> |
|
|
1339
|
+
|
|
1340
|
+
<a name="HTMLElementService+canFocus"></a>
|
|
1341
|
+
|
|
1342
|
+
### htmlElementService.canFocus ⇒ <code>boolean</code>
|
|
1343
|
+
Whether this element can have the focus: form controls and links which are not disabled, and anything with a tabindex.
|
|
1344
|
+
|
|
1345
|
+
**Kind**: instance property of [<code>HTMLElementService</code>](#HTMLElementService)
|
|
1346
|
+
<a name="HTMLElementService+click"></a>
|
|
1347
|
+
|
|
1348
|
+
### htmlElementService.click()
|
|
1349
|
+
Click the element: a click event is sent to it, which bubbles and can be cancelled, like one from a user but a
|
|
1350
|
+
script made it (so it is not trusted). A disabled element does nothing.
|
|
1351
|
+
|
|
1352
|
+
**Kind**: instance method of [<code>HTMLElementService</code>](#HTMLElementService)
|
|
1353
|
+
<a name="HTMLElementService+focus"></a>
|
|
1354
|
+
|
|
1355
|
+
### htmlElementService.focus()
|
|
1356
|
+
Give the element the focus. The element which had it gets blur then focusout, and this one gets focus then
|
|
1357
|
+
focusin (blur and focus do not bubble, focusin and focusout do). Nothing happens when the element cannot have the
|
|
1358
|
+
focus or already has it.
|
|
1359
|
+
|
|
1360
|
+
**Kind**: instance method of [<code>HTMLElementService</code>](#HTMLElementService)
|
|
1361
|
+
<a name="HTMLElementService+blur"></a>
|
|
1362
|
+
|
|
1363
|
+
### htmlElementService.blur()
|
|
1364
|
+
Take the focus away from the element, when it has it: it gets blur then focusout.
|
|
1365
|
+
|
|
1366
|
+
**Kind**: instance method of [<code>HTMLElementService</code>](#HTMLElementService)
|
|
1367
|
+
<a name="FocusEventService"></a>
|
|
1368
|
+
|
|
1369
|
+
## FocusEventService ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1370
|
+
Simulate the behaviour of the FocusEvent Class when there is no DOM available.
|
|
1371
|
+
|
|
1372
|
+
**Kind**: global class
|
|
1373
|
+
**Extends**: [<code>UIEventService</code>](#UIEventService)
|
|
1374
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
1375
|
+
**Properties**
|
|
1376
|
+
|
|
1377
|
+
| Name | Type |
|
|
1378
|
+
| --- | --- |
|
|
1379
|
+
| relatedTarget | <code>PseudoEventTarget</code> \| <code>null</code> |
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
* [FocusEventService](#FocusEventService) ⇐ [<code>UIEventService</code>](#UIEventService)
|
|
1383
|
+
* [new FocusEventService([typeArg], [init])](#new_FocusEventService_new)
|
|
1384
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
1385
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1386
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
1387
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
1388
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
1389
|
+
|
|
1390
|
+
<a name="new_FocusEventService_new"></a>
|
|
1391
|
+
|
|
1392
|
+
### new FocusEventService([typeArg], [init])
|
|
1393
|
+
|
|
1394
|
+
| Param | Type | Default | Description |
|
|
1395
|
+
| --- | --- | --- | --- |
|
|
1396
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
1397
|
+
| [init] | <code>FocusEventInit</code> | <code>{}</code> | The options for the event |
|
|
1398
|
+
|
|
1399
|
+
<a name="EventService+inner"></a>
|
|
277
1400
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
| [attributes] | <code>Array.<PseudoAttr></code> | <code>[]</code> | The attributes to start with |
|
|
1401
|
+
### focusEventService.inner ⇒ <code>EventInner</code>
|
|
1402
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
281
1403
|
|
|
282
|
-
<
|
|
1404
|
+
**Kind**: instance property of [<code>FocusEventService</code>](#FocusEventService)
|
|
1405
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
1406
|
+
<a name="EventService+composedPath"></a>
|
|
283
1407
|
|
|
284
|
-
|
|
285
|
-
|
|
1408
|
+
### focusEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
1409
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
286
1410
|
|
|
287
|
-
**Kind**:
|
|
288
|
-
**
|
|
289
|
-
|
|
290
|
-
**Properties**
|
|
1411
|
+
**Kind**: instance method of [<code>FocusEventService</code>](#FocusEventService)
|
|
1412
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
1413
|
+
<a name="EventService+preventDefault"></a>
|
|
291
1414
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
| hidden | <code>boolean</code> | State of whether element is visible |
|
|
295
|
-
| offsetHeight | <code>number</code> | The height of the element as offset by the parent element |
|
|
296
|
-
| offsetLeft | <code>number</code> | The position of the left side of the element based on the parent element |
|
|
297
|
-
| offsetParent | <code>PseudoHTMLElement</code> | A reference to the closest positioned parent element |
|
|
298
|
-
| offsetTop | <code>number</code> | The position of the top side of the element based on the parent element |
|
|
299
|
-
| offsetWidth | <code>number</code> | The width of the element as offset by the parent element |
|
|
300
|
-
| style | <code>Object</code> | A container to define all applied inline-styles |
|
|
301
|
-
| title | <code>string</code> | The title attribute which affects the text visible on hover |
|
|
1415
|
+
### focusEventService.preventDefault() ⇒ <code>null</code>
|
|
1416
|
+
Cancels the event (if it is cancelable).
|
|
302
1417
|
|
|
303
|
-
<
|
|
1418
|
+
**Kind**: instance method of [<code>FocusEventService</code>](#FocusEventService)
|
|
1419
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
1420
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
304
1421
|
|
|
305
|
-
###
|
|
306
|
-
|
|
1422
|
+
### focusEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
1423
|
+
For this particular event, no other listener will be called.
|
|
1424
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
1425
|
+
capture phase, for instance)
|
|
307
1426
|
|
|
1427
|
+
**Kind**: instance method of [<code>FocusEventService</code>](#FocusEventService)
|
|
1428
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
1429
|
+
<a name="EventService+stopPropagation"></a>
|
|
308
1430
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
| [elementOptions] | <code>Object</code> | <code>{}</code> |
|
|
312
|
-
| [elementOptions.tagName] | <code>string</code> | <code>"''"</code> |
|
|
313
|
-
| [elementOptions.parent] | <code>PseudoNode</code> \| <code>Object</code> | <code>{}</code> |
|
|
314
|
-
| [elementOptions.children] | <code>Array</code> | <code>[]</code> |
|
|
1431
|
+
### focusEventService.stopPropagation() ⇒ <code>null</code>
|
|
1432
|
+
Stops the propagation of events further along in the Dom.
|
|
315
1433
|
|
|
1434
|
+
**Kind**: instance method of [<code>FocusEventService</code>](#FocusEventService)
|
|
1435
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
316
1436
|
<a name="EventTargetService"></a>
|
|
317
1437
|
|
|
318
1438
|
## EventTargetService
|
|
@@ -546,6 +1666,9 @@ Simulate the behaviour of the Element Class when there is no DOM available.
|
|
|
546
1666
|
|
|
547
1667
|
* [ElementService](#ElementService) ⇐ <code>PseudoNode</code>
|
|
548
1668
|
* [new ElementService([settings])](#new_ElementService_new)
|
|
1669
|
+
* [.currentAttributes()](#ElementService+currentAttributes) ⇒ <code>Array.<{name: string, value: \*}></code>
|
|
1670
|
+
* [.cloneShallow()](#ElementService+cloneShallow) ⇒ [<code>ElementService</code>](#ElementService)
|
|
1671
|
+
* [.equalsShallow(other)](#ElementService+equalsShallow) ⇒ <code>boolean</code>
|
|
549
1672
|
* [.applyDefaultEvent()](#ElementService+applyDefaultEvent) ⇒ <code>function</code>
|
|
550
1673
|
* [.childInserted(child)](#ElementService+childInserted)
|
|
551
1674
|
* [.hasAttribute(attributeName)](#ElementService+hasAttribute) ⇒ <code>boolean</code>
|
|
@@ -565,6 +1688,32 @@ Simulate the behaviour of the Element Class when there is no DOM available.
|
|
|
565
1688
|
| [settings.parent] | <code>PseudoNode</code> \| <code>null</code> | <code></code> | The node to add this element to as its last child |
|
|
566
1689
|
| [settings.children] | <code>Array.<PseudoNode></code> | <code>[]</code> | The nodes to start as children |
|
|
567
1690
|
|
|
1691
|
+
<a name="ElementService+currentAttributes"></a>
|
|
1692
|
+
|
|
1693
|
+
### elementService.currentAttributes() ⇒ <code>Array.<{name: string, value: \*}></code>
|
|
1694
|
+
The attributes with the values they have now: the ones which are also properties (className, id, style, ...) can
|
|
1695
|
+
have been changed through the property, which does not change the stored list.
|
|
1696
|
+
|
|
1697
|
+
**Kind**: instance method of [<code>ElementService</code>](#ElementService)
|
|
1698
|
+
<a name="ElementService+cloneShallow"></a>
|
|
1699
|
+
|
|
1700
|
+
### elementService.cloneShallow() ⇒ [<code>ElementService</code>](#ElementService)
|
|
1701
|
+
A copy of this element without its children: the same tag and attributes (the values which are objects, such as
|
|
1702
|
+
style, are copied too rather than shared), but not its parent or listeners.
|
|
1703
|
+
|
|
1704
|
+
**Kind**: instance method of [<code>ElementService</code>](#ElementService)
|
|
1705
|
+
<a name="ElementService+equalsShallow"></a>
|
|
1706
|
+
|
|
1707
|
+
### elementService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
1708
|
+
Elements are equal when they have the same tag and the same attributes (in any order), which is what isEqualNode
|
|
1709
|
+
checks before it compares the children.
|
|
1710
|
+
|
|
1711
|
+
**Kind**: instance method of [<code>ElementService</code>](#ElementService)
|
|
1712
|
+
|
|
1713
|
+
| Param | Type | Description |
|
|
1714
|
+
| --- | --- | --- |
|
|
1715
|
+
| other | [<code>NodeService</code>](#NodeService) | The element to compare with |
|
|
1716
|
+
|
|
568
1717
|
<a name="ElementService+applyDefaultEvent"></a>
|
|
569
1718
|
|
|
570
1719
|
### elementService.applyDefaultEvent() ⇒ <code>function</code>
|
|
@@ -638,16 +1787,26 @@ Simulate the behaviour of the Document Class when there is no DOM available.
|
|
|
638
1787
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
639
1788
|
|
|
640
1789
|
* [DocumentService](#DocumentService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
1790
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
641
1791
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
1792
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
1793
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
642
1794
|
* [.childInserted(child)](#NodeService+childInserted)
|
|
643
|
-
* [.cloneNode()](#NodeService+cloneNode)
|
|
644
|
-
* [.compareDocumentPosition()](#NodeService+compareDocumentPosition)
|
|
1795
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
1796
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
645
1797
|
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
646
1798
|
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
647
|
-
* [.isEqualNode()](#NodeService+isEqualNode)
|
|
1799
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
1800
|
+
* [.normalize()](#NodeService+normalize)
|
|
648
1801
|
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
649
1802
|
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
650
1803
|
|
|
1804
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
1805
|
+
|
|
1806
|
+
### documentService.acceptsChildren ⇒ <code>boolean</code>
|
|
1807
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
1808
|
+
|
|
1809
|
+
**Kind**: instance property of [<code>DocumentService</code>](#DocumentService)
|
|
651
1810
|
<a name="NodeService+appendChild"></a>
|
|
652
1811
|
|
|
653
1812
|
### documentService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -660,6 +1819,25 @@ Add a node as the last child of this node (a node which is already in a tree is
|
|
|
660
1819
|
| --- | --- | --- |
|
|
661
1820
|
| childNode | <code>PseudoNode</code> | The node to add |
|
|
662
1821
|
|
|
1822
|
+
<a name="NodeService+cloneShallow"></a>
|
|
1823
|
+
|
|
1824
|
+
### documentService.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
1825
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
1826
|
+
Kinds of node which are made with arguments override this to give them.
|
|
1827
|
+
|
|
1828
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
1829
|
+
<a name="NodeService+equalsShallow"></a>
|
|
1830
|
+
|
|
1831
|
+
### documentService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
1832
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
1833
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
1834
|
+
|
|
1835
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
1836
|
+
|
|
1837
|
+
| Param | Type | Description |
|
|
1838
|
+
| --- | --- | --- |
|
|
1839
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
1840
|
+
|
|
663
1841
|
<a name="NodeService+childInserted"></a>
|
|
664
1842
|
|
|
665
1843
|
### documentService.childInserted(child)
|
|
@@ -674,23 +1852,29 @@ Called each time a node has been inserted as a child of this node, so that nodes
|
|
|
674
1852
|
|
|
675
1853
|
<a name="NodeService+cloneNode"></a>
|
|
676
1854
|
|
|
677
|
-
### documentService.cloneNode()
|
|
678
|
-
|
|
1855
|
+
### documentService.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
1856
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
1857
|
+
too, all the way down.
|
|
679
1858
|
|
|
680
1859
|
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
681
|
-
**Throws**:
|
|
682
1860
|
|
|
683
|
-
|
|
1861
|
+
| Param | Type | Default | Description |
|
|
1862
|
+
| --- | --- | --- | --- |
|
|
1863
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
684
1864
|
|
|
685
1865
|
<a name="NodeService+compareDocumentPosition"></a>
|
|
686
1866
|
|
|
687
|
-
### documentService.compareDocumentPosition()
|
|
688
|
-
|
|
1867
|
+
### documentService.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
1868
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
1869
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
1870
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
1871
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
689
1872
|
|
|
690
1873
|
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
691
|
-
**Throws**:
|
|
692
1874
|
|
|
693
|
-
|
|
1875
|
+
| Param | Type | Description |
|
|
1876
|
+
| --- | --- | --- |
|
|
1877
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
694
1878
|
|
|
695
1879
|
<a name="NodeService+contains"></a>
|
|
696
1880
|
|
|
@@ -723,14 +1907,22 @@ already in a tree is moved, and the children of a document fragment are moved in
|
|
|
723
1907
|
|
|
724
1908
|
<a name="NodeService+isEqualNode"></a>
|
|
725
1909
|
|
|
726
|
-
### documentService.isEqualNode()
|
|
727
|
-
|
|
1910
|
+
### documentService.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
1911
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
1912
|
+
needs the same attributes), and children which are equal in the same order.
|
|
728
1913
|
|
|
729
1914
|
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
730
|
-
**Throws**:
|
|
731
1915
|
|
|
732
|
-
|
|
1916
|
+
| Param | Type | Description |
|
|
1917
|
+
| --- | --- | --- |
|
|
1918
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
1919
|
+
|
|
1920
|
+
<a name="NodeService+normalize"></a>
|
|
1921
|
+
|
|
1922
|
+
### documentService.normalize()
|
|
1923
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
733
1924
|
|
|
1925
|
+
**Kind**: instance method of [<code>DocumentService</code>](#DocumentService)
|
|
734
1926
|
<a name="NodeService+removeChild"></a>
|
|
735
1927
|
|
|
736
1928
|
### documentService.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
@@ -775,16 +1967,26 @@ not part of a tree, when it is inserted its children are moved into the tree ins
|
|
|
775
1967
|
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
776
1968
|
|
|
777
1969
|
* [DocumentFragmentService](#DocumentFragmentService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
1970
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
778
1971
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
1972
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
1973
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
779
1974
|
* [.childInserted(child)](#NodeService+childInserted)
|
|
780
|
-
* [.cloneNode()](#NodeService+cloneNode)
|
|
781
|
-
* [.compareDocumentPosition()](#NodeService+compareDocumentPosition)
|
|
1975
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
1976
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
782
1977
|
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
783
1978
|
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
784
|
-
* [.isEqualNode()](#NodeService+isEqualNode)
|
|
1979
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
1980
|
+
* [.normalize()](#NodeService+normalize)
|
|
785
1981
|
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
786
1982
|
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
787
1983
|
|
|
1984
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
1985
|
+
|
|
1986
|
+
### documentFragmentService.acceptsChildren ⇒ <code>boolean</code>
|
|
1987
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
1988
|
+
|
|
1989
|
+
**Kind**: instance property of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
788
1990
|
<a name="NodeService+appendChild"></a>
|
|
789
1991
|
|
|
790
1992
|
### documentFragmentService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -797,6 +1999,25 @@ Add a node as the last child of this node (a node which is already in a tree is
|
|
|
797
1999
|
| --- | --- | --- |
|
|
798
2000
|
| childNode | <code>PseudoNode</code> | The node to add |
|
|
799
2001
|
|
|
2002
|
+
<a name="NodeService+cloneShallow"></a>
|
|
2003
|
+
|
|
2004
|
+
### documentFragmentService.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
2005
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
2006
|
+
Kinds of node which are made with arguments override this to give them.
|
|
2007
|
+
|
|
2008
|
+
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2009
|
+
<a name="NodeService+equalsShallow"></a>
|
|
2010
|
+
|
|
2011
|
+
### documentFragmentService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
2012
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
2013
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
2014
|
+
|
|
2015
|
+
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2016
|
+
|
|
2017
|
+
| Param | Type | Description |
|
|
2018
|
+
| --- | --- | --- |
|
|
2019
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
2020
|
+
|
|
800
2021
|
<a name="NodeService+childInserted"></a>
|
|
801
2022
|
|
|
802
2023
|
### documentFragmentService.childInserted(child)
|
|
@@ -811,23 +2032,29 @@ Called each time a node has been inserted as a child of this node, so that nodes
|
|
|
811
2032
|
|
|
812
2033
|
<a name="NodeService+cloneNode"></a>
|
|
813
2034
|
|
|
814
|
-
### documentFragmentService.cloneNode()
|
|
815
|
-
|
|
2035
|
+
### documentFragmentService.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
2036
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
2037
|
+
too, all the way down.
|
|
816
2038
|
|
|
817
2039
|
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
818
|
-
**Throws**:
|
|
819
2040
|
|
|
820
|
-
|
|
2041
|
+
| Param | Type | Default | Description |
|
|
2042
|
+
| --- | --- | --- | --- |
|
|
2043
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
821
2044
|
|
|
822
2045
|
<a name="NodeService+compareDocumentPosition"></a>
|
|
823
2046
|
|
|
824
|
-
### documentFragmentService.compareDocumentPosition()
|
|
825
|
-
|
|
2047
|
+
### documentFragmentService.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
2048
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
2049
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
2050
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
2051
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
826
2052
|
|
|
827
2053
|
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
828
|
-
**Throws**:
|
|
829
2054
|
|
|
830
|
-
|
|
2055
|
+
| Param | Type | Description |
|
|
2056
|
+
| --- | --- | --- |
|
|
2057
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
831
2058
|
|
|
832
2059
|
<a name="NodeService+contains"></a>
|
|
833
2060
|
|
|
@@ -860,14 +2087,22 @@ already in a tree is moved, and the children of a document fragment are moved in
|
|
|
860
2087
|
|
|
861
2088
|
<a name="NodeService+isEqualNode"></a>
|
|
862
2089
|
|
|
863
|
-
### documentFragmentService.isEqualNode()
|
|
864
|
-
|
|
2090
|
+
### documentFragmentService.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
2091
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
2092
|
+
needs the same attributes), and children which are equal in the same order.
|
|
865
2093
|
|
|
866
2094
|
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
867
|
-
**Throws**:
|
|
868
2095
|
|
|
869
|
-
|
|
2096
|
+
| Param | Type | Description |
|
|
2097
|
+
| --- | --- | --- |
|
|
2098
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
2099
|
+
|
|
2100
|
+
<a name="NodeService+normalize"></a>
|
|
2101
|
+
|
|
2102
|
+
### documentFragmentService.normalize()
|
|
2103
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
870
2104
|
|
|
2105
|
+
**Kind**: instance method of [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
871
2106
|
<a name="NodeService+removeChild"></a>
|
|
872
2107
|
|
|
873
2108
|
### documentFragmentService.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
@@ -917,6 +2152,75 @@ Simulate the behaviour of the DOMTokenList Class when there is no DOM available.
|
|
|
917
2152
|
| [value] | <code>string</code> | <code>"''"</code> | The space separated tokens to start with |
|
|
918
2153
|
| [onChange] | <code>function</code> | | Called with the new value whenever the tokens change |
|
|
919
2154
|
|
|
2155
|
+
<a name="CustomEventService"></a>
|
|
2156
|
+
|
|
2157
|
+
## CustomEventService ⇐ [<code>EventService</code>](#EventService)
|
|
2158
|
+
Simulate the behaviour of the CustomEvent Class when there is no DOM available: an event which carries data.
|
|
2159
|
+
|
|
2160
|
+
**Kind**: global class
|
|
2161
|
+
**Extends**: [<code>EventService</code>](#EventService)
|
|
2162
|
+
**Author**: Joshua Heagle <joshuaheagle@gmail.com>
|
|
2163
|
+
**Properties**
|
|
2164
|
+
|
|
2165
|
+
| Name | Type |
|
|
2166
|
+
| --- | --- |
|
|
2167
|
+
| detail | <code>\*</code> |
|
|
2168
|
+
|
|
2169
|
+
|
|
2170
|
+
* [CustomEventService](#CustomEventService) ⇐ [<code>EventService</code>](#EventService)
|
|
2171
|
+
* [new CustomEventService([typeArg], [init])](#new_CustomEventService_new)
|
|
2172
|
+
* [.inner](#EventService+inner) ⇒ <code>EventInner</code>
|
|
2173
|
+
* [.composedPath()](#EventService+composedPath) ⇒ <code>Array.<PseudoEventTarget></code>
|
|
2174
|
+
* [.preventDefault()](#EventService+preventDefault) ⇒ <code>null</code>
|
|
2175
|
+
* [.stopImmediatePropagation()](#EventService+stopImmediatePropagation) ⇒ <code>null</code>
|
|
2176
|
+
* [.stopPropagation()](#EventService+stopPropagation) ⇒ <code>null</code>
|
|
2177
|
+
|
|
2178
|
+
<a name="new_CustomEventService_new"></a>
|
|
2179
|
+
|
|
2180
|
+
### new CustomEventService([typeArg], [init])
|
|
2181
|
+
|
|
2182
|
+
| Param | Type | Default | Description |
|
|
2183
|
+
| --- | --- | --- | --- |
|
|
2184
|
+
| [typeArg] | <code>string</code> | <code>"''"</code> | The type of the event |
|
|
2185
|
+
| [init] | <code>CustomEventInit</code> | <code>{}</code> | The options for the event |
|
|
2186
|
+
|
|
2187
|
+
<a name="EventService+inner"></a>
|
|
2188
|
+
|
|
2189
|
+
### customEventService.inner ⇒ <code>EventInner</code>
|
|
2190
|
+
Scope several accessors inside the inner object. These are only intended for usage by other DOM classes.
|
|
2191
|
+
|
|
2192
|
+
**Kind**: instance property of [<code>CustomEventService</code>](#CustomEventService)
|
|
2193
|
+
**Overrides**: [<code>inner</code>](#EventService+inner)
|
|
2194
|
+
<a name="EventService+composedPath"></a>
|
|
2195
|
+
|
|
2196
|
+
### customEventService.composedPath() ⇒ <code>Array.<PseudoEventTarget></code>
|
|
2197
|
+
Return an array of targets that will have the event executed open them. The order is based on the eventPhase
|
|
2198
|
+
|
|
2199
|
+
**Kind**: instance method of [<code>CustomEventService</code>](#CustomEventService)
|
|
2200
|
+
**Overrides**: [<code>composedPath</code>](#EventService+composedPath)
|
|
2201
|
+
<a name="EventService+preventDefault"></a>
|
|
2202
|
+
|
|
2203
|
+
### customEventService.preventDefault() ⇒ <code>null</code>
|
|
2204
|
+
Cancels the event (if it is cancelable).
|
|
2205
|
+
|
|
2206
|
+
**Kind**: instance method of [<code>CustomEventService</code>](#CustomEventService)
|
|
2207
|
+
**Overrides**: [<code>preventDefault</code>](#EventService+preventDefault)
|
|
2208
|
+
<a name="EventService+stopImmediatePropagation"></a>
|
|
2209
|
+
|
|
2210
|
+
### customEventService.stopImmediatePropagation() ⇒ <code>null</code>
|
|
2211
|
+
For this particular event, no other listener will be called.
|
|
2212
|
+
Neither those attached on the same element, nor those attached on elements which will be traversed later (in
|
|
2213
|
+
capture phase, for instance)
|
|
2214
|
+
|
|
2215
|
+
**Kind**: instance method of [<code>CustomEventService</code>](#CustomEventService)
|
|
2216
|
+
**Overrides**: [<code>stopImmediatePropagation</code>](#EventService+stopImmediatePropagation)
|
|
2217
|
+
<a name="EventService+stopPropagation"></a>
|
|
2218
|
+
|
|
2219
|
+
### customEventService.stopPropagation() ⇒ <code>null</code>
|
|
2220
|
+
Stops the propagation of events further along in the Dom.
|
|
2221
|
+
|
|
2222
|
+
**Kind**: instance method of [<code>CustomEventService</code>](#CustomEventService)
|
|
2223
|
+
**Overrides**: [<code>stopPropagation</code>](#EventService+stopPropagation)
|
|
920
2224
|
<a name="AttrService"></a>
|
|
921
2225
|
|
|
922
2226
|
## AttrService ⇐ [<code>NodeService</code>](#NodeService)
|
|
@@ -928,13 +2232,17 @@ Simulate the behaviour of the Attr Class when there is no DOM available.
|
|
|
928
2232
|
|
|
929
2233
|
* [AttrService](#AttrService) ⇐ [<code>NodeService</code>](#NodeService)
|
|
930
2234
|
* [new AttrService(name, [value], [ownerElement], [namespaceURI], [prefix])](#new_AttrService_new)
|
|
2235
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
931
2236
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
2237
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
2238
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
932
2239
|
* [.childInserted(child)](#NodeService+childInserted)
|
|
933
|
-
* [.cloneNode()](#NodeService+cloneNode)
|
|
934
|
-
* [.compareDocumentPosition()](#NodeService+compareDocumentPosition)
|
|
2240
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
2241
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
935
2242
|
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
936
2243
|
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
937
|
-
* [.isEqualNode()](#NodeService+isEqualNode)
|
|
2244
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
2245
|
+
* [.normalize()](#NodeService+normalize)
|
|
938
2246
|
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
939
2247
|
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
940
2248
|
|
|
@@ -950,6 +2258,13 @@ Simulate the behaviour of the Attr Class when there is no DOM available.
|
|
|
950
2258
|
| [namespaceURI] | <code>string</code> | <code>"''"</code> | The namespace of the attribute |
|
|
951
2259
|
| [prefix] | <code>string</code> \| <code>null</code> | <code>null</code> | The namespace prefix of the attribute |
|
|
952
2260
|
|
|
2261
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
2262
|
+
|
|
2263
|
+
### attrService.acceptsChildren ⇒ <code>boolean</code>
|
|
2264
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
2265
|
+
|
|
2266
|
+
**Kind**: instance property of [<code>AttrService</code>](#AttrService)
|
|
2267
|
+
**Overrides**: [<code>acceptsChildren</code>](#NodeService+acceptsChildren)
|
|
953
2268
|
<a name="NodeService+appendChild"></a>
|
|
954
2269
|
|
|
955
2270
|
### attrService.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -963,6 +2278,27 @@ Add a node as the last child of this node (a node which is already in a tree is
|
|
|
963
2278
|
| --- | --- | --- |
|
|
964
2279
|
| childNode | <code>PseudoNode</code> | The node to add |
|
|
965
2280
|
|
|
2281
|
+
<a name="NodeService+cloneShallow"></a>
|
|
2282
|
+
|
|
2283
|
+
### attrService.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
2284
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
2285
|
+
Kinds of node which are made with arguments override this to give them.
|
|
2286
|
+
|
|
2287
|
+
**Kind**: instance method of [<code>AttrService</code>](#AttrService)
|
|
2288
|
+
**Overrides**: [<code>cloneShallow</code>](#NodeService+cloneShallow)
|
|
2289
|
+
<a name="NodeService+equalsShallow"></a>
|
|
2290
|
+
|
|
2291
|
+
### attrService.equalsShallow(other) ⇒ <code>boolean</code>
|
|
2292
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
2293
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
2294
|
+
|
|
2295
|
+
**Kind**: instance method of [<code>AttrService</code>](#AttrService)
|
|
2296
|
+
**Overrides**: [<code>equalsShallow</code>](#NodeService+equalsShallow)
|
|
2297
|
+
|
|
2298
|
+
| Param | Type | Description |
|
|
2299
|
+
| --- | --- | --- |
|
|
2300
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
2301
|
+
|
|
966
2302
|
<a name="NodeService+childInserted"></a>
|
|
967
2303
|
|
|
968
2304
|
### attrService.childInserted(child)
|
|
@@ -978,25 +2314,31 @@ Called each time a node has been inserted as a child of this node, so that nodes
|
|
|
978
2314
|
|
|
979
2315
|
<a name="NodeService+cloneNode"></a>
|
|
980
2316
|
|
|
981
|
-
### attrService.cloneNode()
|
|
982
|
-
|
|
2317
|
+
### attrService.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
2318
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
2319
|
+
too, all the way down.
|
|
983
2320
|
|
|
984
2321
|
**Kind**: instance method of [<code>AttrService</code>](#AttrService)
|
|
985
2322
|
**Overrides**: [<code>cloneNode</code>](#NodeService+cloneNode)
|
|
986
|
-
**Throws**:
|
|
987
2323
|
|
|
988
|
-
|
|
2324
|
+
| Param | Type | Default | Description |
|
|
2325
|
+
| --- | --- | --- | --- |
|
|
2326
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
989
2327
|
|
|
990
2328
|
<a name="NodeService+compareDocumentPosition"></a>
|
|
991
2329
|
|
|
992
|
-
### attrService.compareDocumentPosition()
|
|
993
|
-
|
|
2330
|
+
### attrService.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
2331
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
2332
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
2333
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
2334
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
994
2335
|
|
|
995
2336
|
**Kind**: instance method of [<code>AttrService</code>](#AttrService)
|
|
996
2337
|
**Overrides**: [<code>compareDocumentPosition</code>](#NodeService+compareDocumentPosition)
|
|
997
|
-
**Throws**:
|
|
998
2338
|
|
|
999
|
-
|
|
2339
|
+
| Param | Type | Description |
|
|
2340
|
+
| --- | --- | --- |
|
|
2341
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
1000
2342
|
|
|
1001
2343
|
<a name="NodeService+contains"></a>
|
|
1002
2344
|
|
|
@@ -1031,15 +2373,24 @@ already in a tree is moved, and the children of a document fragment are moved in
|
|
|
1031
2373
|
|
|
1032
2374
|
<a name="NodeService+isEqualNode"></a>
|
|
1033
2375
|
|
|
1034
|
-
### attrService.isEqualNode()
|
|
1035
|
-
|
|
2376
|
+
### attrService.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
2377
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
2378
|
+
needs the same attributes), and children which are equal in the same order.
|
|
1036
2379
|
|
|
1037
2380
|
**Kind**: instance method of [<code>AttrService</code>](#AttrService)
|
|
1038
2381
|
**Overrides**: [<code>isEqualNode</code>](#NodeService+isEqualNode)
|
|
1039
|
-
**Throws**:
|
|
1040
2382
|
|
|
1041
|
-
|
|
2383
|
+
| Param | Type | Description |
|
|
2384
|
+
| --- | --- | --- |
|
|
2385
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
2386
|
+
|
|
2387
|
+
<a name="NodeService+normalize"></a>
|
|
1042
2388
|
|
|
2389
|
+
### attrService.normalize()
|
|
2390
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
2391
|
+
|
|
2392
|
+
**Kind**: instance method of [<code>AttrService</code>](#AttrService)
|
|
2393
|
+
**Overrides**: [<code>normalize</code>](#NodeService+normalize)
|
|
1043
2394
|
<a name="NodeService+removeChild"></a>
|
|
1044
2395
|
|
|
1045
2396
|
### attrService.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
@@ -1087,13 +2438,17 @@ from that linker, and its parent from the linker's parent when it has not been g
|
|
|
1087
2438
|
|
|
1088
2439
|
* [LinkedNode](#LinkedNode) ⇐ [<code>NodeService</code>](#NodeService)
|
|
1089
2440
|
* [new LinkedNode(linker, value)](#new_LinkedNode_new)
|
|
2441
|
+
* [.acceptsChildren](#NodeService+acceptsChildren) ⇒ <code>boolean</code>
|
|
1090
2442
|
* [.appendChild(childNode)](#NodeService+appendChild) ⇒ <code>PseudoNode</code>
|
|
2443
|
+
* [.cloneShallow()](#NodeService+cloneShallow) ⇒ [<code>NodeService</code>](#NodeService)
|
|
2444
|
+
* [.equalsShallow(other)](#NodeService+equalsShallow) ⇒ <code>boolean</code>
|
|
1091
2445
|
* [.childInserted(child)](#NodeService+childInserted)
|
|
1092
|
-
* [.cloneNode()](#NodeService+cloneNode)
|
|
1093
|
-
* [.compareDocumentPosition()](#NodeService+compareDocumentPosition)
|
|
2446
|
+
* [.cloneNode([deep])](#NodeService+cloneNode) ⇒ <code>PseudoNode</code>
|
|
2447
|
+
* [.compareDocumentPosition(otherNode)](#NodeService+compareDocumentPosition) ⇒ <code>number</code>
|
|
1094
2448
|
* [.contains(otherNode)](#NodeService+contains) ⇒ <code>boolean</code>
|
|
1095
2449
|
* [.insertBefore(newNode, [referenceNode])](#NodeService+insertBefore) ⇒ <code>PseudoNode</code>
|
|
1096
|
-
* [.isEqualNode()](#NodeService+isEqualNode)
|
|
2450
|
+
* [.isEqualNode(otherNode)](#NodeService+isEqualNode) ⇒ <code>boolean</code>
|
|
2451
|
+
* [.normalize()](#NodeService+normalize)
|
|
1097
2452
|
* [.removeChild(childElement)](#NodeService+removeChild) ⇒ <code>PseudoNode</code>
|
|
1098
2453
|
* [.replaceChild(newChild, oldChild)](#NodeService+replaceChild) ⇒ <code>PseudoNode</code>
|
|
1099
2454
|
|
|
@@ -1106,6 +2461,13 @@ from that linker, and its parent from the linker's parent when it has not been g
|
|
|
1106
2461
|
| linker | <code>TreeLinker</code> | The linker holding this node |
|
|
1107
2462
|
| value | <code>string</code> \| <code>null</code> | The value of the node |
|
|
1108
2463
|
|
|
2464
|
+
<a name="NodeService+acceptsChildren"></a>
|
|
2465
|
+
|
|
2466
|
+
### linkedNode.acceptsChildren ⇒ <code>boolean</code>
|
|
2467
|
+
Whether this kind of node can have children (text, comments and attributes cannot).
|
|
2468
|
+
|
|
2469
|
+
**Kind**: instance property of [<code>LinkedNode</code>](#LinkedNode)
|
|
2470
|
+
**Overrides**: [<code>acceptsChildren</code>](#NodeService+acceptsChildren)
|
|
1109
2471
|
<a name="NodeService+appendChild"></a>
|
|
1110
2472
|
|
|
1111
2473
|
### linkedNode.appendChild(childNode) ⇒ <code>PseudoNode</code>
|
|
@@ -1119,6 +2481,27 @@ Add a node as the last child of this node (a node which is already in a tree is
|
|
|
1119
2481
|
| --- | --- | --- |
|
|
1120
2482
|
| childNode | <code>PseudoNode</code> | The node to add |
|
|
1121
2483
|
|
|
2484
|
+
<a name="NodeService+cloneShallow"></a>
|
|
2485
|
+
|
|
2486
|
+
### linkedNode.cloneShallow() ⇒ [<code>NodeService</code>](#NodeService)
|
|
2487
|
+
Make a copy of this node without its children, its parent or its listeners, which is what cloneNode starts from.
|
|
2488
|
+
Kinds of node which are made with arguments override this to give them.
|
|
2489
|
+
|
|
2490
|
+
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
2491
|
+
**Overrides**: [<code>cloneShallow</code>](#NodeService+cloneShallow)
|
|
2492
|
+
<a name="NodeService+equalsShallow"></a>
|
|
2493
|
+
|
|
2494
|
+
### linkedNode.equalsShallow(other) ⇒ <code>boolean</code>
|
|
2495
|
+
Whether another node of the same type is equal to this one apart from its children, which isEqualNode compares
|
|
2496
|
+
afterwards. Kinds of node with more to compare (an element has attributes) override this.
|
|
2497
|
+
|
|
2498
|
+
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
2499
|
+
**Overrides**: [<code>equalsShallow</code>](#NodeService+equalsShallow)
|
|
2500
|
+
|
|
2501
|
+
| Param | Type | Description |
|
|
2502
|
+
| --- | --- | --- |
|
|
2503
|
+
| other | [<code>NodeService</code>](#NodeService) | The node to compare with |
|
|
2504
|
+
|
|
1122
2505
|
<a name="NodeService+childInserted"></a>
|
|
1123
2506
|
|
|
1124
2507
|
### linkedNode.childInserted(child)
|
|
@@ -1134,25 +2517,31 @@ Called each time a node has been inserted as a child of this node, so that nodes
|
|
|
1134
2517
|
|
|
1135
2518
|
<a name="NodeService+cloneNode"></a>
|
|
1136
2519
|
|
|
1137
|
-
### linkedNode.cloneNode()
|
|
1138
|
-
|
|
2520
|
+
### linkedNode.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
2521
|
+
Make a copy of this node (without its parent, and without its event listeners). With deep the children are copied
|
|
2522
|
+
too, all the way down.
|
|
1139
2523
|
|
|
1140
2524
|
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
1141
2525
|
**Overrides**: [<code>cloneNode</code>](#NodeService+cloneNode)
|
|
1142
|
-
**Throws**:
|
|
1143
2526
|
|
|
1144
|
-
|
|
2527
|
+
| Param | Type | Default | Description |
|
|
2528
|
+
| --- | --- | --- | --- |
|
|
2529
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy the children as well |
|
|
1145
2530
|
|
|
1146
2531
|
<a name="NodeService+compareDocumentPosition"></a>
|
|
1147
2532
|
|
|
1148
|
-
### linkedNode.compareDocumentPosition()
|
|
1149
|
-
|
|
2533
|
+
### linkedNode.compareDocumentPosition(otherNode) ⇒ <code>number</code>
|
|
2534
|
+
Say where another node is in relation to this one, as the bits of NodeService.DOCUMENT_POSITION_*: 0 for this node
|
|
2535
|
+
itself, DISCONNECTED (with IMPLEMENTATION_SPECIFIC and a consistent PRECEDING or FOLLOWING) for a node in another tree,
|
|
2536
|
+
CONTAINS + PRECEDING when the other node is an ancestor, CONTAINED_BY + FOLLOWING when it is a descendant,
|
|
2537
|
+
otherwise PRECEDING or FOLLOWING by their order in the tree.
|
|
1150
2538
|
|
|
1151
2539
|
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
1152
2540
|
**Overrides**: [<code>compareDocumentPosition</code>](#NodeService+compareDocumentPosition)
|
|
1153
|
-
**Throws**:
|
|
1154
2541
|
|
|
1155
|
-
|
|
2542
|
+
| Param | Type | Description |
|
|
2543
|
+
| --- | --- | --- |
|
|
2544
|
+
| otherNode | <code>PseudoNode</code> | The node to locate |
|
|
1156
2545
|
|
|
1157
2546
|
<a name="NodeService+contains"></a>
|
|
1158
2547
|
|
|
@@ -1187,15 +2576,24 @@ already in a tree is moved, and the children of a document fragment are moved in
|
|
|
1187
2576
|
|
|
1188
2577
|
<a name="NodeService+isEqualNode"></a>
|
|
1189
2578
|
|
|
1190
|
-
### linkedNode.isEqualNode()
|
|
1191
|
-
|
|
2579
|
+
### linkedNode.isEqualNode(otherNode) ⇒ <code>boolean</code>
|
|
2580
|
+
Whether another node is the same as this one, by what they hold: the same type, name and value (an element also
|
|
2581
|
+
needs the same attributes), and children which are equal in the same order.
|
|
1192
2582
|
|
|
1193
2583
|
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
1194
2584
|
**Overrides**: [<code>isEqualNode</code>](#NodeService+isEqualNode)
|
|
1195
|
-
**Throws**:
|
|
1196
2585
|
|
|
1197
|
-
|
|
2586
|
+
| Param | Type | Description |
|
|
2587
|
+
| --- | --- | --- |
|
|
2588
|
+
| otherNode | <code>PseudoNode</code> \| <code>null</code> | The node to compare with |
|
|
2589
|
+
|
|
2590
|
+
<a name="NodeService+normalize"></a>
|
|
1198
2591
|
|
|
2592
|
+
### linkedNode.normalize()
|
|
2593
|
+
Tidy the text below this node: neighbouring text nodes are joined into one and empty text nodes are removed.
|
|
2594
|
+
|
|
2595
|
+
**Kind**: instance method of [<code>LinkedNode</code>](#LinkedNode)
|
|
2596
|
+
**Overrides**: [<code>normalize</code>](#NodeService+normalize)
|
|
1199
2597
|
<a name="NodeService+removeChild"></a>
|
|
1200
2598
|
|
|
1201
2599
|
### linkedNode.removeChild(childElement) ⇒ <code>PseudoNode</code>
|
|
@@ -1285,6 +2683,10 @@ Simulate the behaviour of the HTMLDocument Class when there is no DOM available.
|
|
|
1285
2683
|
* [.head](#PseudoHTMLDocument+head) : <code>PseudoHTMLElement</code>
|
|
1286
2684
|
* [.body](#PseudoHTMLDocument+body) : <code>PseudoHTMLElement</code>
|
|
1287
2685
|
* [.createElement(tagName)](#PseudoHTMLDocument+createElement) ⇒ <code>PseudoHTMLElement</code>
|
|
2686
|
+
* [.createTextNode([data])](#PseudoHTMLDocument+createTextNode) ⇒ [<code>TextService</code>](#TextService)
|
|
2687
|
+
* [.createComment([data])](#PseudoHTMLDocument+createComment) ⇒ [<code>CommentService</code>](#CommentService)
|
|
2688
|
+
* [.createDocumentFragment()](#PseudoHTMLDocument+createDocumentFragment) ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2689
|
+
* [.cloneNode([deep])](#PseudoHTMLDocument+cloneNode) ⇒ <code>PseudoNode</code>
|
|
1288
2690
|
|
|
1289
2691
|
<a name="new_PseudoHTMLDocument_new"></a>
|
|
1290
2692
|
|
|
@@ -1306,7 +2708,7 @@ Create document body element
|
|
|
1306
2708
|
<a name="PseudoHTMLDocument+createElement"></a>
|
|
1307
2709
|
|
|
1308
2710
|
### pseudoHTMLDocument.createElement(tagName) ⇒ <code>PseudoHTMLElement</code>
|
|
1309
|
-
|
|
2711
|
+
Make an element of the given type which belongs to this document but is not added anywhere until it is appended.
|
|
1310
2712
|
|
|
1311
2713
|
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
1312
2714
|
|
|
@@ -1314,6 +2716,47 @@ Create and return a PseudoHTMLElement, which is not added to the document until
|
|
|
1314
2716
|
| --- | --- | --- | --- |
|
|
1315
2717
|
| tagName | <code>string</code> | <code>"div"</code> | Tag Name is a string representing the type of Dom element this represents |
|
|
1316
2718
|
|
|
2719
|
+
<a name="PseudoHTMLDocument+createTextNode"></a>
|
|
2720
|
+
|
|
2721
|
+
### pseudoHTMLDocument.createTextNode([data]) ⇒ [<code>TextService</code>](#TextService)
|
|
2722
|
+
Make a text node which belongs to this document.
|
|
2723
|
+
|
|
2724
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
2725
|
+
|
|
2726
|
+
| Param | Type | Default | Description |
|
|
2727
|
+
| --- | --- | --- | --- |
|
|
2728
|
+
| [data] | <code>string</code> | <code>"''"</code> | The text |
|
|
2729
|
+
|
|
2730
|
+
<a name="PseudoHTMLDocument+createComment"></a>
|
|
2731
|
+
|
|
2732
|
+
### pseudoHTMLDocument.createComment([data]) ⇒ [<code>CommentService</code>](#CommentService)
|
|
2733
|
+
Make a comment which belongs to this document.
|
|
2734
|
+
|
|
2735
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
2736
|
+
|
|
2737
|
+
| Param | Type | Default | Description |
|
|
2738
|
+
| --- | --- | --- | --- |
|
|
2739
|
+
| [data] | <code>string</code> | <code>"''"</code> | The comment |
|
|
2740
|
+
|
|
2741
|
+
<a name="PseudoHTMLDocument+createDocumentFragment"></a>
|
|
2742
|
+
|
|
2743
|
+
### pseudoHTMLDocument.createDocumentFragment() ⇒ [<code>DocumentFragmentService</code>](#DocumentFragmentService)
|
|
2744
|
+
Make an empty document fragment which belongs to this document, a container for nodes which can be built up and
|
|
2745
|
+
then inserted in one go.
|
|
2746
|
+
|
|
2747
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
2748
|
+
<a name="PseudoHTMLDocument+cloneNode"></a>
|
|
2749
|
+
|
|
2750
|
+
### pseudoHTMLDocument.cloneNode([deep]) ⇒ <code>PseudoNode</code>
|
|
2751
|
+
Make a copy of this document. The copy has no parent or listeners, and a deep copy has copies of everything in the
|
|
2752
|
+
document (a shallow one is an empty document).
|
|
2753
|
+
|
|
2754
|
+
**Kind**: instance method of [<code>PseudoHTMLDocument</code>](#PseudoHTMLDocument)
|
|
2755
|
+
|
|
2756
|
+
| Param | Type | Default | Description |
|
|
2757
|
+
| --- | --- | --- | --- |
|
|
2758
|
+
| [deep] | <code>boolean</code> | <code>false</code> | Copy everything in the document as well |
|
|
2759
|
+
|
|
1317
2760
|
<a name="PseudoEventListener"></a>
|
|
1318
2761
|
|
|
1319
2762
|
## PseudoEventListener
|
|
@@ -1442,10 +2885,48 @@ current one.
|
|
|
1442
2885
|
| --- | --- |
|
|
1443
2886
|
| event | <code>PseudoEvent</code> |
|
|
1444
2887
|
|
|
2888
|
+
<a name="eventDefaults"></a>
|
|
2889
|
+
|
|
2890
|
+
## eventDefaults : <code>Object.<string, EventDefinition></code>
|
|
2891
|
+
The events which the browser itself creates (for a user action, or for something like element.click()) have these
|
|
2892
|
+
options. A script which creates an event with the constructor gets none of them (everything is false) unless it asks
|
|
2893
|
+
for them, which is why createEvent only uses this table when it is told the browser is creating the event.
|
|
2894
|
+
The values follow the UI Events, HTML, Pointer Events, Clipboard, Drag and Drop, Touch and CSS specifications.
|
|
2895
|
+
|
|
2896
|
+
**Kind**: global variable
|
|
2897
|
+
<a name="focused"></a>
|
|
2898
|
+
|
|
2899
|
+
## focused
|
|
2900
|
+
The element which has the focus, kept for each tree (the root node of the tree it is in), like document.activeElement.
|
|
2901
|
+
|
|
2902
|
+
**Kind**: global constant
|
|
1445
2903
|
<a name="HTMLElementService_1"></a>
|
|
1446
2904
|
|
|
1447
2905
|
## HTMLElementService\_1 : <code>PseudoHTMLElement</code>
|
|
1448
2906
|
**Kind**: global constant
|
|
2907
|
+
<a name="modifierKeys"></a>
|
|
2908
|
+
|
|
2909
|
+
## modifierKeys([init]) ⇒ <code>ModifierKeys</code>
|
|
2910
|
+
Pick the modifier keys out of the init object of an event.
|
|
2911
|
+
|
|
2912
|
+
**Kind**: global function
|
|
2913
|
+
|
|
2914
|
+
| Param | Type | Default | Description |
|
|
2915
|
+
| --- | --- | --- | --- |
|
|
2916
|
+
| [init] | <code>Object</code> | <code>{}</code> | The init of an event |
|
|
2917
|
+
|
|
2918
|
+
<a name="modifierState"></a>
|
|
2919
|
+
|
|
2920
|
+
## modifierState(keys, key) ⇒ <code>boolean</code>
|
|
2921
|
+
Answer getModifierState for a set of held modifier keys.
|
|
2922
|
+
|
|
2923
|
+
**Kind**: global function
|
|
2924
|
+
|
|
2925
|
+
| Param | Type | Description |
|
|
2926
|
+
| --- | --- | --- |
|
|
2927
|
+
| keys | <code>ModifierKeys</code> | The modifier keys which were held down |
|
|
2928
|
+
| key | <code>string</code> | The name of the modifier (Control, Shift, Alt or Meta) |
|
|
2929
|
+
|
|
1449
2930
|
<a name="getParentNodesFromAttribute"></a>
|
|
1450
2931
|
|
|
1451
2932
|
## getParentNodesFromAttribute(attr, value, node) ⇒ <code>Array.<PseudoNode></code>
|
|
@@ -1473,6 +2954,29 @@ order in which an event travels down through them). A node which has no parent h
|
|
|
1473
2954
|
| --- | --- | --- |
|
|
1474
2955
|
| node | <code>PseudoEventTarget</code> \| <code>PseudoNode</code> \| <code>\*</code> | The node to find the ancestors of |
|
|
1475
2956
|
|
|
2957
|
+
<a name="getActiveElement"></a>
|
|
2958
|
+
|
|
2959
|
+
## getActiveElement(root) ⇒ <code>Object</code> \| <code>null</code>
|
|
2960
|
+
Find the element which has the focus in a tree.
|
|
2961
|
+
|
|
2962
|
+
**Kind**: global function
|
|
2963
|
+
|
|
2964
|
+
| Param | Type | Description |
|
|
2965
|
+
| --- | --- | --- |
|
|
2966
|
+
| root | <code>Object</code> | The root node of the tree |
|
|
2967
|
+
|
|
2968
|
+
<a name="setActiveElement"></a>
|
|
2969
|
+
|
|
2970
|
+
## setActiveElement(root, element)
|
|
2971
|
+
Remember the element which has the focus in a tree.
|
|
2972
|
+
|
|
2973
|
+
**Kind**: global function
|
|
2974
|
+
|
|
2975
|
+
| Param | Type | Description |
|
|
2976
|
+
| --- | --- | --- |
|
|
2977
|
+
| root | <code>Object</code> | The root node of the tree |
|
|
2978
|
+
| element | <code>Object</code> \| <code>null</code> | The element which now has the focus, or null when nothing has it |
|
|
2979
|
+
|
|
1476
2980
|
<a name="generateNodeList"></a>
|
|
1477
2981
|
|
|
1478
2982
|
## generateNodeList([innerList]) ⇒ [<code>PseudoNodeList</code>](#PseudoNodeList)
|
|
@@ -1537,3 +3041,20 @@ Create an instance of HTMLElement if not available
|
|
|
1537
3041
|
Define document when not available
|
|
1538
3042
|
|
|
1539
3043
|
**Kind**: inner constant of [<code>generateDocument</code>](#generateDocument)
|
|
3044
|
+
<a name="createEvent"></a>
|
|
3045
|
+
|
|
3046
|
+
## createEvent(type, [init], [options]) ⇒ [<code>EventService</code>](#EventService)
|
|
3047
|
+
Create an event of the kind which suits its type (a click is a MouseEvent, a keydown a KeyboardEvent, ...).
|
|
3048
|
+
By default this is like using the constructor of the event in a script: nothing bubbles or can be cancelled unless
|
|
3049
|
+
the init says so, and the event is not trusted. With browser: true the event is created the way the browser creates
|
|
3050
|
+
it, using the standard options for its type (see eventDefaults), and trusted: true makes it look like it came from a
|
|
3051
|
+
real user action (isTrusted).
|
|
3052
|
+
|
|
3053
|
+
**Kind**: global function
|
|
3054
|
+
|
|
3055
|
+
| Param | Type | Default | Description |
|
|
3056
|
+
| --- | --- | --- | --- |
|
|
3057
|
+
| type | <code>string</code> | | The type of the event, such as click |
|
|
3058
|
+
| [init] | <code>Object</code> | <code>{}</code> | The options for the event (bubbles, cancelable, composed and those of its kind of event) |
|
|
3059
|
+
| [options] | <code>CreateEventOptions</code> | <code>{}</code> | Whether the browser is creating the event, and whether it is trusted |
|
|
3060
|
+
|