@ctrl/dom 0.3.9 → 0.3.11
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 +12 -105
- package/dist/aria/_chunks/{aria-query.generated-BivoZ-ec.js → aria-query.generated-BG-n1PE9.js} +2 -2
- package/dist/aria/_chunks/{aria-query.generated-CeGmXXFh.cjs → aria-query.generated-BqD80bJk.cjs} +1 -1
- package/dist/aria/index.cjs +1 -1
- package/dist/aria/index.js +1 -1
- package/dist/aria/internal.cjs +1 -1
- package/dist/aria/internal.js +1 -1
- package/dist/aria/types/forms.d.ts +0 -2
- package/dist/bridge/internal.js +1 -1
- package/dist/dom/_chunks/src-B3vkUXY6.js +50 -0
- package/dist/dom/index.js +1 -1
- package/dist/dom/internal.js +1 -1
- package/dist/dom/types/collections/NodeList.d.ts +2 -0
- package/dist/dom/types/css/cascade.d.ts +5 -6
- package/dist/dom/types/css/media.d.ts +0 -2
- package/dist/dom/types/css/parser.d.ts +0 -2
- package/dist/dom/types/css/properties.d.ts +0 -2
- package/dist/dom/types/css/shorthands.d.ts +0 -2
- package/dist/dom/types/css/style-deps.d.ts +18 -4
- package/dist/dom/types/css/stylesheets.d.ts +14 -18
- package/dist/dom/types/css/values.d.ts +0 -1
- package/dist/dom/types/events/DataTransfer.d.ts +3 -2
- package/dist/dom/types/events/handler-names.d.ts +4 -0
- package/dist/dom/types/events/handlers.d.ts +1 -5
- package/dist/dom/types/events/listeners.d.ts +10 -7
- package/dist/dom/types/html/events.d.ts +14 -8
- package/dist/dom/types/html/focus.d.ts +0 -2
- package/dist/dom/types/html/forms/HTMLOptionElement.d.ts +8 -0
- package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +20 -3
- package/dist/dom/types/html/forms/collections.d.ts +14 -2
- package/dist/dom/types/html/forms/control-state.d.ts +5 -0
- package/dist/dom/types/html/forms/face.d.ts +1 -2
- package/dist/dom/types/html/forms/form-associated.d.ts +4 -2
- package/dist/dom/types/html/forms/index.d.ts +1 -2
- package/dist/dom/types/html/forms/microsyntaxes.d.ts +0 -3
- package/dist/dom/types/html/forms/state.d.ts +0 -1
- package/dist/dom/types/html/reflect.d.ts +0 -4
- package/dist/dom/types/html/resources.d.ts +0 -2
- package/dist/dom/types/html/shared.d.ts +0 -2
- package/dist/dom/types/html/template.d.ts +0 -3
- package/dist/dom/types/html/top-layer.d.ts +26 -3
- package/dist/dom/types/keys.d.ts +19 -1
- package/dist/dom/types/nodes/Document.d.ts +11 -3
- package/dist/dom/types/nodes/attributes.d.ts +3 -0
- package/dist/dom/types/nodes/traverse.d.ts +10 -4
- package/dist/dom/types/observers/MutationObserver.d.ts +5 -5
- package/dist/dom/types/observers/MutationRecord.d.ts +2 -1
- package/dist/dom/types/observers/queue.d.ts +19 -20
- package/dist/dom/types/parser/index.d.ts +1 -1
- package/dist/dom/types/parser/tokenizer.d.ts +0 -2
- package/dist/dom/types/selectors/compile.d.ts +2 -2
- package/dist/dom/types/selectors/index.d.ts +2 -6
- package/dist/dom/types/selectors/internal.d.ts +3 -6
- package/dist/dom/types/selectors/parser.d.ts +0 -5
- package/dist/dom/types/selectors/state.d.ts +0 -5
- package/dist/dom/types/serializer/index.d.ts +0 -2
- package/dist/dom/types/traversal/Range.d.ts +1 -3
- package/dist/dom/types/traversal/live.d.ts +8 -4
- package/dist/dom/types/{events/convert.d.ts → webidl-convert.d.ts} +0 -2
- package/dist/dom/types/window/FileReader.d.ts +6 -2
- package/dist/dom/types/window/Storage.d.ts +16 -5
- package/dist/dom/types/window/Window.d.ts +2 -2
- package/dist/dom/types/window/clock.d.ts +21 -14
- package/dist/dom/types/window/devtools-console.d.ts +2 -0
- package/dist/dom/types/window/shared-accessors.d.ts +9 -0
- package/dist/dom/types/window/timers.d.ts +10 -6
- package/dist/jest-dom/_chunks/matchers-DGsBvtWC.js +1 -1
- package/dist/react/_chunks/pure-0apusBJy.cjs +1 -0
- package/dist/react/_chunks/pure-CRYsLxrp.js +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/pure.cjs +1 -1
- package/dist/react/pure.js +1 -1
- package/dist/react/types/config.d.ts +3 -1
- package/dist/react/types/fire-event.d.ts +1 -1
- package/dist/react/types/pure.d.ts +2 -2
- package/dist/testing-library/_chunks/aria-snapshot-diff-BSXxnyqJ.js +1 -1
- package/dist/testing-library/agent.js +1 -1
- package/dist/testing-library/index.js +1 -1
- package/dist/user-event/index.cjs +16 -16
- package/dist/user-event/index.js +16 -16
- package/dist/user-event/types/ctrl-dom.d.ts +0 -13
- package/dist/user-event/types/event/selection/selectBoundaries.d.ts +2 -0
- package/dist/user-event/types/pointer/index.d.ts +1 -1
- package/dist/user-event/types/pointer/parseKeyDef.d.ts +2 -5
- package/dist/user-event/types/setup/dtl.d.ts +0 -2
- package/dist/user-event/types/system/index.d.ts +2 -1
- package/dist/user-event/types/system/keyboard.d.ts +1 -1
- package/dist/user-event/types/system/pointer/device.d.ts +5 -4
- package/dist/user-event/types/utility/upload.d.ts +1 -4
- package/dist/user-event/types/utils/keyDef/readNextDescriptor.d.ts +1 -1
- package/dist/vitest-environment/failure-snapshot.js +1 -1
- package/dist/vitest-environment/plugin.js +1 -1
- package/dist/vitest-environment/types/warm-forks.d.ts +0 -7
- package/package.json +2 -3
- package/dist/dom/_chunks/src-DqpTBH8Z.js +0 -50
- package/dist/react/_chunks/pure-C0lYKcec.js +0 -1
- package/dist/react/_chunks/pure-xBh9btvi.cjs +0 -1
- package/dist/react/types/dtl.d.ts +0 -1
|
@@ -13,5 +13,4 @@ export { HTMLInputElement, HTMLTextAreaElement, HTMLSelectElement, HTMLOptionEle
|
|
|
13
13
|
export { ValidityState } from "./validation.js";
|
|
14
14
|
export { FormData } from "./FormData.js";
|
|
15
15
|
export { HTMLFormControlsCollection, HTMLOptionsCollection, RadioNodeList } from "./collections.js";
|
|
16
|
-
export { implicitSubmission
|
|
17
|
-
export { formOwner, labeledControl, isLabelable, isListed, isSubmittable, isResettable } from "./form-associated.js";
|
|
16
|
+
export { implicitSubmission } from "./form-submission.js";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare function isValidFloatString(s: string): boolean;
|
|
2
1
|
/**
|
|
3
2
|
* https://html.spec.whatwg.org/#rules-for-parsing-floating-point-number-values, restricted to
|
|
4
3
|
* valid floating-point numbers (what value sanitization requires). NaN on error.
|
|
@@ -21,8 +20,6 @@ export declare function isValidDateString(s: string): boolean;
|
|
|
21
20
|
export declare function isValidMonthString(s: string): boolean;
|
|
22
21
|
/** https://html.spec.whatwg.org/#valid-week-string */
|
|
23
22
|
export declare function isValidWeekString(s: string): boolean;
|
|
24
|
-
/** https://html.spec.whatwg.org/#valid-time-string */
|
|
25
|
-
export declare function isValidTimeString(s: string): boolean;
|
|
26
23
|
/**
|
|
27
24
|
* Value sanitization for datetime-local: a valid local date and time string becomes the
|
|
28
25
|
* valid normalized one (T separator, shortest time); anything else becomes "".
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { NodeImpl } from "../../nodes/NodeImpl.js";
|
|
2
|
-
export { isActuallyDisabled } from "./form-associated.js";
|
|
3
2
|
/** `:disabled` — https://html.spec.whatwg.org/#selector-disabled */
|
|
4
3
|
export declare function isDisabled(el: NodeImpl): boolean;
|
|
5
4
|
/** `:enabled` — button, input, select, textarea, optgroup, option, fieldset that are not disabled. */
|
|
@@ -42,8 +42,6 @@ export declare function nonNegativeLong(C: Ctor, list: string, def?: number): vo
|
|
|
42
42
|
export declare function ulong(C: Ctor, list: string, def?: number, positive?: boolean): void;
|
|
43
43
|
/** `unsigned long` clamped to [min, max] (e.g. colSpan, rowSpan). */
|
|
44
44
|
export declare function clampedUlong(C: Ctor, idl: string, content: string, def: number, min: number, max: number): void;
|
|
45
|
-
/** `double` reflection; `positive` = limited to only positive numbers. */
|
|
46
|
-
export declare function double(C: Ctor, list: string, def?: number, positive?: boolean): void;
|
|
47
45
|
export interface EnumSpec {
|
|
48
46
|
/** Canonical keywords (lowercase). Aliases: "alias:canonical". */
|
|
49
47
|
keywords: string[];
|
|
@@ -63,6 +61,4 @@ export declare const LOADING: EnumSpec;
|
|
|
63
61
|
export declare const FETCH_PRIORITY: EnumSpec;
|
|
64
62
|
/** Reflect a DOMTokenList-valued IDL attribute (`relList`, `sandbox`, `sizes`, ...) — [SameObject, PutForwards=value]. */
|
|
65
63
|
export declare function tokenList(C: Ctor, idl: string, content: string, supported?: readonly string[] | null): void;
|
|
66
|
-
/** Whether `impl` is an HTML-namespace element. */
|
|
67
|
-
export declare function isHTMLElement(impl: NodeImpl): boolean;
|
|
68
64
|
export {};
|
|
@@ -11,8 +11,6 @@ export interface StyleSheetHooks {
|
|
|
11
11
|
createLinkSheet: ((owner: NodeImpl, href: string, media: string) => object | null) | null;
|
|
12
12
|
}
|
|
13
13
|
export declare const styleSheetHooks: StyleSheetHooks;
|
|
14
|
-
/** The CSS style sheet associated with a <style>/<link> element (for document.styleSheets). */
|
|
15
|
-
export declare function associatedSheet(impl: NodeImpl): object | null;
|
|
16
14
|
/** https://html.spec.whatwg.org/#child-text-content */
|
|
17
15
|
export declare function childTextContent(impl: NodeImpl): string;
|
|
18
16
|
/** https://html.spec.whatwg.org/#update-a-style-block */
|
|
@@ -5,8 +5,6 @@ import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
|
5
5
|
* [hidden] and <head> included; author style sheets and inline styles when present).
|
|
6
6
|
*/
|
|
7
7
|
export declare function isRenderingHidden(impl: NodeImpl): boolean;
|
|
8
|
-
/** The element's own computed display is none (ancestors not considered). */
|
|
9
|
-
export declare function isOwnDisplayNone(impl: NodeImpl): boolean;
|
|
10
8
|
/** https://html.spec.whatwg.org/#attr-contenteditable state of an element's own attribute. */
|
|
11
9
|
export declare function contentEditableState(impl: NodeImpl): number;
|
|
12
10
|
/** https://html.spec.whatwg.org/#dom-document-designmode (getter). */
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { HTMLElement } from "./HTMLElement.js";
|
|
2
2
|
import { Document } from "../nodes/Document.js";
|
|
3
3
|
import { DocumentFragment } from "../nodes/DocumentFragment.js";
|
|
4
|
-
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
5
4
|
import type { Element } from "../nodes/Element.js";
|
|
6
5
|
/** https://html.spec.whatwg.org/#appropriate-template-contents-owner-document */
|
|
7
6
|
export declare function templateContentsOwner(doc: Document): Document;
|
|
8
|
-
/** The template contents fragment of a template element (created on first use). */
|
|
9
|
-
export declare function templateContents(impl: NodeImpl): NodeImpl;
|
|
10
7
|
export declare class HTMLTemplateElement extends HTMLElement {
|
|
11
8
|
constructor(doc?: Document, localName?: string, ns?: string | null, prefix?: string | null);
|
|
12
9
|
/** https://html.spec.whatwg.org/#dom-template-content */
|
|
@@ -12,6 +12,29 @@ export interface CloseWatcher {
|
|
|
12
12
|
isRunningCancelAction: boolean;
|
|
13
13
|
doc: Document;
|
|
14
14
|
}
|
|
15
|
+
export interface TopLayerState {
|
|
16
|
+
/** https://html.spec.whatwg.org/#top-layer — bottom to top. */
|
|
17
|
+
layer: NodeImpl[];
|
|
18
|
+
/** Open dialogs whose `is modal` flag is set, in the order they were shown. */
|
|
19
|
+
modals: NodeImpl[];
|
|
20
|
+
/** https://html.spec.whatwg.org/#open-dialogs-list */
|
|
21
|
+
openDialogs: NodeImpl[];
|
|
22
|
+
/**
|
|
23
|
+
* The close watcher manager's groups, flattened (https://html.spec.whatwg.org/#close-watcher-manager).
|
|
24
|
+
* Every watcher gets its own group, as if each was created with history-action activation.
|
|
25
|
+
*/
|
|
26
|
+
watchers: CloseWatcher[];
|
|
27
|
+
/** https://html.spec.whatwg.org/#popover-pointerdown-target */
|
|
28
|
+
popoverPointerdownTarget: WeakRef<NodeImpl> | null;
|
|
29
|
+
/** https://html.spec.whatwg.org/#dialog-pointerdown-target */
|
|
30
|
+
dialogPointerdownTarget: WeakRef<NodeImpl> | null;
|
|
31
|
+
/** https://html.spec.whatwg.org/#hint-stack-parent */
|
|
32
|
+
hintStackParent: NodeImpl | null;
|
|
33
|
+
/** https://html.spec.whatwg.org/#document-showing-popover */
|
|
34
|
+
showingPopover: boolean;
|
|
35
|
+
/** https://html.spec.whatwg.org/#hiding-popover-nesting-count */
|
|
36
|
+
hidingPopoverNestingCount: number;
|
|
37
|
+
}
|
|
15
38
|
export declare function addToTopLayer(el: NodeImpl): void;
|
|
16
39
|
/** https://drafts.csswg.org/css-position-4/#remove-an-element-from-the-top-layer-immediately */
|
|
17
40
|
export declare function removeFromTopLayer(el: NodeImpl): void;
|
|
@@ -64,10 +87,10 @@ export declare function showPopover(el: NodeImpl, throwExceptions: boolean, sour
|
|
|
64
87
|
/** https://html.spec.whatwg.org/#hide-popover-algorithm */
|
|
65
88
|
export declare function hidePopover(el: NodeImpl, focusPreviousElement: boolean, fireEvents: boolean, throwExceptions: boolean, source: NodeImpl | null): void;
|
|
66
89
|
export declare function setTopLayerFocusHooks(focus: (el: NodeImpl) => void, autofocusDelegate: (el: NodeImpl) => NodeImpl | null): void;
|
|
67
|
-
export declare function setTopLayerDialogHooks(focusing: (el: NodeImpl) => void, lightDismiss: (
|
|
90
|
+
export declare function setTopLayerDialogHooks(focusing: (el: NodeImpl) => void, lightDismiss: (s: TopLayerState, target: NodeImpl, type: string) => void): void;
|
|
68
91
|
/** Popover part of the HTML element removing steps (https://html.spec.whatwg.org/#the-popover-attribute:html-element-removing-steps). */
|
|
69
92
|
export declare function topLayerRemovingSteps(el: NodeImpl): void;
|
|
70
93
|
/** Popover attribute change steps (https://html.spec.whatwg.org/#the-popover-attribute:concept-element-attributes-change-ext). */
|
|
71
94
|
export declare function popoverAttributeChanged(el: NodeImpl, oldValue: string | null, value: string | null): void;
|
|
72
|
-
/**
|
|
73
|
-
export declare function
|
|
95
|
+
/** Compare the endpoints of a light-dismiss gesture without retaining a removed overlay. */
|
|
96
|
+
export declare function matchesLightDismissTarget(s: TopLayerState, key: "dialogPointerdownTarget" | "popoverPointerdownTarget", type: string, ancestor: NodeImpl | null): boolean;
|
package/dist/dom/types/keys.d.ts
CHANGED
|
@@ -74,6 +74,17 @@ export declare const $firingSubmissionEvents: unique symbol;
|
|
|
74
74
|
export declare const $focused: unique symbol;
|
|
75
75
|
export declare const $form: unique symbol;
|
|
76
76
|
export declare const $formControlsVersion: unique symbol;
|
|
77
|
+
/**
|
|
78
|
+
* Document: counts what besides the tree decides which label labels which control: an `id`, a
|
|
79
|
+
* label's `for`, an input becoming or ceasing to be hidden, a form-associated custom element's
|
|
80
|
+
* upgrade (@ctrl/dom/aria forms.ts labelMapForTree).
|
|
81
|
+
*/
|
|
82
|
+
export declare const $labelsVersion: unique symbol;
|
|
83
|
+
/** Document: counts `id` and `name` attribute changes (html/forms/collections.ts namedControl). */
|
|
84
|
+
export declare const $controlNamesVersion: unique symbol;
|
|
85
|
+
/** Document: the element whose `name` was just set to "", and the name it had (nodes/attributes.ts noteNameChange). */
|
|
86
|
+
export declare const $nameBlanked: unique symbol;
|
|
87
|
+
export declare const $nameBlankedValue: unique symbol;
|
|
77
88
|
/** Document: an element of it has had a `form` attribute (sticky; html/forms/form-associated.ts formOwnerScope). */
|
|
78
89
|
export declare const $formAttrSeen: unique symbol;
|
|
79
90
|
export declare const $forLabels: unique symbol;
|
|
@@ -85,7 +96,6 @@ export declare const $frameTask: unique symbol;
|
|
|
85
96
|
export declare const $frameTime: unique symbol;
|
|
86
97
|
export declare const $generation: unique symbol;
|
|
87
98
|
export declare const $globalObject: unique symbol;
|
|
88
|
-
export declare const $hasTransients: unique symbol;
|
|
89
99
|
export declare const $height: unique symbol;
|
|
90
100
|
export declare const $history: unique symbol;
|
|
91
101
|
export declare const $home: unique symbol;
|
|
@@ -164,6 +174,11 @@ export declare const $selector: unique symbol;
|
|
|
164
174
|
export declare const $serializable: unique symbol;
|
|
165
175
|
export declare const $sessionStorage: unique symbol;
|
|
166
176
|
export declare const $settled: unique symbol;
|
|
177
|
+
/** A select's bookkeeping for options appended one at a time (HTMLSelectElement.ts _childrenChangedSteps). */
|
|
178
|
+
export declare const $optionsTail: unique symbol;
|
|
179
|
+
export declare const $optionsCount: unique symbol;
|
|
180
|
+
export declare const $optionsOnly: unique symbol;
|
|
181
|
+
export declare const $selectionEpoch: unique symbol;
|
|
167
182
|
export declare const $shadowRoot: unique symbol;
|
|
168
183
|
export declare const $shed: unique symbol;
|
|
169
184
|
export declare const $sheet: unique symbol;
|
|
@@ -177,8 +192,11 @@ export declare const $supportsText: unique symbol;
|
|
|
177
192
|
export declare const $systemId: unique symbol;
|
|
178
193
|
export declare const $target: unique symbol;
|
|
179
194
|
export declare const $tasks: unique symbol;
|
|
195
|
+
/** Document's appropriate template contents owner, allocated on first use. */
|
|
196
|
+
export declare const $templateContentsOwner: unique symbol;
|
|
180
197
|
export declare const $timers: unique symbol;
|
|
181
198
|
export declare const $title: unique symbol;
|
|
199
|
+
export declare const $transients: unique symbol;
|
|
182
200
|
export declare const $treeVersion: unique symbol;
|
|
183
201
|
export declare const $type: unique symbol;
|
|
184
202
|
export declare const $types: unique symbol;
|
|
@@ -16,7 +16,7 @@ import type { Window } from "../window/Window.js";
|
|
|
16
16
|
import type { NodeList } from "../collections/NodeList.js";
|
|
17
17
|
import type { ElementCreationOptions } from "../webidl.js";
|
|
18
18
|
import type { Event } from "../events/Event.js";
|
|
19
|
-
import { $aboutBase, $baseFor, $baseOverride, $baseURL, $baseVersion, $benign, $contentType, $css, $derived, $doc, $externalFormNames, $focused, $forLabels, $formAttrSeen, $formControlsVersion, $forms, $ids, $implementation, $isHTML, $mode, $radios, $ranges, $selection, $styleVersion, $treeVersion, $url, $version, $window, $writeBuffer } from "../keys.js";
|
|
19
|
+
import { $aboutBase, $baseFor, $baseOverride, $baseURL, $baseVersion, $benign, $contentType, $css, $derived, $doc, $externalFormNames, $focused, $forLabels, $formAttrSeen, $controlNamesVersion, $labelsVersion, $formControlsVersion, $nameBlanked, $nameBlankedValue, $forms, $ids, $implementation, $isHTML, $mode, $radios, $ranges, $selection, $styleVersion, $templateContentsOwner, $treeVersion, $url, $version, $window, $writeBuffer } from "../keys.js";
|
|
20
20
|
export declare class Document extends Node {
|
|
21
21
|
/** Browsing context's window, or null for documents created via DOMImplementation / new Document(). */
|
|
22
22
|
[$window]: Window | null;
|
|
@@ -42,6 +42,7 @@ export declare class Document extends Node {
|
|
|
42
42
|
[$implementation]: DOMImplementation | null;
|
|
43
43
|
/** Opaque per-document state owned by src/css (style sheet list, rule index). */
|
|
44
44
|
[$css]: object | null;
|
|
45
|
+
[$templateContentsOwner]?: Document;
|
|
45
46
|
/** Markup written since document.open() (null when no open() is in effect). */
|
|
46
47
|
[$writeBuffer]: string | null;
|
|
47
48
|
/** https://w3c.github.io/selection-api/#dfn-selection — created on first getSelection(). */
|
|
@@ -63,6 +64,13 @@ export declare class Document extends Node {
|
|
|
63
64
|
[$formAttrSeen]: boolean;
|
|
64
65
|
/** Non-structural changes to form ownership or the category of listed controls. */
|
|
65
66
|
[$formControlsVersion]: number;
|
|
67
|
+
/** Changes to label associations other than the tree's (keys.ts $labelsVersion). */
|
|
68
|
+
[$labelsVersion]: number;
|
|
69
|
+
/** `id` and `name` attribute changes: stamps a form's index of its controls by name. */
|
|
70
|
+
[$controlNamesVersion]: number;
|
|
71
|
+
/** An element whose `name` was set to "" and not yet set again, with the name it had (attributes.ts). */
|
|
72
|
+
[$nameBlanked]: NodeImpl | null;
|
|
73
|
+
[$nameBlankedValue]: string;
|
|
66
74
|
/** Named controls whose form owner can change on a mutation elsewhere in the tree. */
|
|
67
75
|
[$externalFormNames]?: ExternalNames;
|
|
68
76
|
/**
|
|
@@ -153,8 +161,8 @@ export declare class Document extends Node {
|
|
|
153
161
|
/**
|
|
154
162
|
* https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint — the DocumentOrShadowRoot
|
|
155
163
|
* hit test (ShadowRoot.ts has the same pair). With no layout there is no box at any point, so
|
|
156
|
-
* the result is null, as for a point outside the viewport. jsdom has neither method
|
|
157
|
-
* (window/compat.ts).
|
|
164
|
+
* the result is null, as for a point outside the viewport. jsdom has neither method, and
|
|
165
|
+
* axe-core depends on that, so only the "modern" profile exposes them (window/compat.ts).
|
|
158
166
|
*/
|
|
159
167
|
elementFromPoint(_x: number, _y: number): Element | null;
|
|
160
168
|
/** https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint — an empty sequence, as above. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Document } from "./Document.js";
|
|
1
2
|
import { AttrRecord, type NodeImpl } from "./NodeImpl.js";
|
|
2
3
|
/** Connected elements keyed by an attribute value. Allocate a list only when a key is shared. */
|
|
3
4
|
export type ElementIndex = Map<string, NodeImpl | NodeImpl[]>;
|
|
@@ -67,6 +68,8 @@ export declare function removeAttributeByLocalName(el: NodeImpl, localName: stri
|
|
|
67
68
|
* attribute bookkeeping (id index, class token cache, style flag, document version).
|
|
68
69
|
*/
|
|
69
70
|
export declare function handleAttributeChanges(el: NodeImpl, a: AttrRecord, oldValue: string | null, newValue: string | null): void;
|
|
71
|
+
/** A name set to "" is in effect for whoever looks now: count it (see noteNameChange). */
|
|
72
|
+
export declare function flushBlankedName(doc: Document): void;
|
|
70
73
|
/**
|
|
71
74
|
* Parser/clone fast path: append an attribute to a DETACHED element without mutation
|
|
72
75
|
* records, hooks or version bumps, but with core bookkeeping (id mirror, style flag).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { NodeImpl } from "./NodeImpl.js";
|
|
2
|
-
/** Next node in tree order within
|
|
3
|
-
export declare function nextInTree(n: NodeImpl, root: NodeImpl): NodeImpl | null;
|
|
4
|
-
/** Next node in tree order
|
|
5
|
-
export declare function nextSkippingChildren(n: NodeImpl, root: NodeImpl): NodeImpl | null;
|
|
2
|
+
/** Next node in tree order within the subtree (or the whole tree when unbounded). */
|
|
3
|
+
export declare function nextInTree(n: NodeImpl, root: NodeImpl | null): NodeImpl | null;
|
|
4
|
+
/** Next node in tree order after the subtree of `n`, optionally bounded by `root`. */
|
|
5
|
+
export declare function nextSkippingChildren(n: NodeImpl, root: NodeImpl | null): NodeImpl | null;
|
|
6
6
|
/** Previous node in tree order within `root`'s subtree (root itself included), or null. */
|
|
7
7
|
export declare function previousInTree(n: NodeImpl, root: NodeImpl): NodeImpl | null;
|
|
8
8
|
/** Next element in tree order within `root`'s subtree, or null. */
|
|
@@ -11,6 +11,8 @@ export declare function firstElementChild(n: NodeImpl): NodeImpl | null;
|
|
|
11
11
|
export declare function lastElementChild(n: NodeImpl): NodeImpl | null;
|
|
12
12
|
export declare function nextElementSibling(n: NodeImpl): NodeImpl | null;
|
|
13
13
|
export declare function previousElementSibling(n: NodeImpl): NodeImpl | null;
|
|
14
|
+
/** Whether a precedes b, given two distinct children of the same parent. */
|
|
15
|
+
export declare function siblingPrecedes(a: NodeImpl, b: NodeImpl): boolean;
|
|
14
16
|
/** Root of the tree containing `n` (not shadow-including). https://dom.spec.whatwg.org/#concept-tree-root */
|
|
15
17
|
export declare function treeRoot(n: NodeImpl): NodeImpl;
|
|
16
18
|
/** Whether `a` is an inclusive ancestor of `b`. */
|
|
@@ -19,5 +21,9 @@ export declare function isInclusiveAncestor(a: NodeImpl, b: NodeImpl): boolean;
|
|
|
19
21
|
export declare function indexOf(n: NodeImpl): number;
|
|
20
22
|
/** Child at `index`, walking from whichever end is closer. */
|
|
21
23
|
export declare function childAt(parent: NodeImpl, index: number): NodeImpl | null;
|
|
24
|
+
/** Snapshot a child interval before mutations can change sibling links. */
|
|
25
|
+
export declare function snapshotChildren(parent: NodeImpl, start?: number, end?: number): NodeImpl[];
|
|
26
|
+
/** Position of b relative to a in the ordinary (not shadow-including) tree. */
|
|
27
|
+
export declare function relativeTreePosition(a: NodeImpl, b: NodeImpl): number;
|
|
22
28
|
/** Negative if a precedes b in tree order (https://dom.spec.whatwg.org/#concept-tree-order). */
|
|
23
29
|
export declare function compareTreeOrder(a: NodeImpl, b: NodeImpl): number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Node } from "../nodes/Node.js";
|
|
2
|
-
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
3
2
|
import type { MutationRecord } from "./MutationRecord.js";
|
|
4
|
-
import {
|
|
3
|
+
import { RegisteredObserver, type ObservedNode } from "./queue.js";
|
|
4
|
+
import { $callback, $transients, $id, $nodes, $records } from "../keys.js";
|
|
5
5
|
export interface MutationObserverInit {
|
|
6
6
|
childList?: boolean;
|
|
7
7
|
attributes?: boolean;
|
|
@@ -20,9 +20,9 @@ export declare class MutationObserver {
|
|
|
20
20
|
/** @internal https://dom.spec.whatwg.org/#concept-mo-queue */
|
|
21
21
|
[$records]: MutationRecord[];
|
|
22
22
|
/** @internal https://dom.spec.whatwg.org/#mutationobserver-node-list (nodes with a registration of this observer). */
|
|
23
|
-
[$nodes]:
|
|
24
|
-
/** @internal
|
|
25
|
-
[$
|
|
23
|
+
[$nodes]: Set<ObservedNode>;
|
|
24
|
+
/** @internal Temporary subtree registrations until the next delivery. */
|
|
25
|
+
[$transients]: RegisteredObserver[] | null;
|
|
26
26
|
constructor(callback: MutationCallback);
|
|
27
27
|
/** https://dom.spec.whatwg.org/#dom-mutationobserver-observe */
|
|
28
28
|
observe(target: Node, options?: MutationObserverInit): void;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NodeList } from "../collections/NodeList.js";
|
|
2
2
|
import type { Node } from "../nodes/Node.js";
|
|
3
3
|
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
4
|
+
export type MutationNodes = NodeImpl | NodeImpl[] | null;
|
|
4
5
|
export declare class MutationRecord {
|
|
5
6
|
#private;
|
|
6
7
|
/** @internal Records are created by the mutation algorithms only. */
|
|
7
|
-
constructor(type: string, target: NodeImpl, name: string | null, namespace: string | null, oldValue: string | null, added:
|
|
8
|
+
constructor(type: string, target: NodeImpl, name: string | null, namespace: string | null, oldValue: string | null, added: MutationNodes, removed: MutationNodes, previousSibling: NodeImpl | null, nextSibling: NodeImpl | null);
|
|
8
9
|
get type(): string;
|
|
9
10
|
get target(): Node;
|
|
10
11
|
get addedNodes(): NodeList;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
|
+
import { type MutationNodes } from "./MutationRecord.js";
|
|
2
3
|
import type { MutationObserver, MutationObserverInit } from "./MutationObserver.js";
|
|
3
|
-
/** Number of MutationObservers with
|
|
4
|
+
/** Number of MutationObservers with registrations, including those awaiting transient cleanup. */
|
|
4
5
|
export declare let activeObservers: number;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Number of non-transient registrations with `subtree` (a transient one exists only while its
|
|
8
|
-
* source does: disconnect() and re-observing remove it). With none, a mutation can interest only
|
|
9
|
-
* observers registered on its target and a removal adds no transient observers, so neither walks
|
|
10
|
-
* the target's ancestors. Base UI keeps childList- and attribute-only observers connected while
|
|
11
|
-
* its lists are mounted, and every removal anywhere walked to the root: 145 ms in the
|
|
12
|
-
* `interactions` preset's profiles, plus 53 ms in queueMutationRecord.
|
|
13
|
-
*/
|
|
6
|
+
/** With no subtree registrations, neither queueing a record nor removing a child needs an ancestor walk. */
|
|
14
7
|
export declare let subtreeObservers: number;
|
|
15
|
-
|
|
8
|
+
/** The observer and the finalizer can enumerate these without retaining a target, callback, or document. */
|
|
9
|
+
export declare class ObservedNode extends WeakRef<NodeImpl> {
|
|
10
|
+
readonly nodes: Set<ObservedNode>;
|
|
11
|
+
subtree: boolean;
|
|
12
|
+
constructor(node: NodeImpl, nodes: Set<ObservedNode>, subtree: boolean);
|
|
13
|
+
}
|
|
16
14
|
/** https://dom.spec.whatwg.org/#registered-observer (and transient registered observer when `source` is set). */
|
|
17
15
|
export declare class RegisteredObserver {
|
|
18
|
-
observer: MutationObserver;
|
|
16
|
+
readonly observer: MutationObserver;
|
|
19
17
|
options: NormalizedOptions;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
constructor(observer: MutationObserver, options: NormalizedOptions, source: RegisteredObserver | null);
|
|
18
|
+
readonly source: RegisteredObserver | null;
|
|
19
|
+
readonly target: ObservedNode;
|
|
20
|
+
constructor(node: NodeImpl, observer: MutationObserver, options: NormalizedOptions, source: RegisteredObserver | null);
|
|
21
|
+
updateOptions(options: NormalizedOptions): void;
|
|
23
22
|
}
|
|
24
23
|
/** MutationObserverInit after the defaulting steps of observe(). */
|
|
25
24
|
export declare class NormalizedOptions {
|
|
@@ -35,9 +34,9 @@ export declare class NormalizedOptions {
|
|
|
35
34
|
/** https://dom.spec.whatwg.org/#registered-observer-list */
|
|
36
35
|
export declare function registeredObserverList(node: NodeImpl): RegisteredObserver[] | null;
|
|
37
36
|
export declare function addRegistration(node: NodeImpl, registered: RegisteredObserver): void;
|
|
38
|
-
/**
|
|
39
|
-
export declare function
|
|
40
|
-
export declare function queueTreeMutationRecord(target: NodeImpl, added:
|
|
37
|
+
/** Release the observer's weak reference and the target's corresponding registration. */
|
|
38
|
+
export declare function removeRegistration(ref: ObservedNode): void;
|
|
39
|
+
export declare function queueTreeMutationRecord(target: NodeImpl, added: MutationNodes, removed: MutationNodes, previousSibling: NodeImpl | null, nextSibling: NodeImpl | null): void;
|
|
41
40
|
export declare function queueAttributeMutationRecord(target: NodeImpl, localName: string, namespace: string | null, oldValue: string | null): void;
|
|
42
41
|
export declare function queueCharacterDataMutationRecord(target: NodeImpl, oldValue: string): void;
|
|
43
42
|
/**
|
|
@@ -49,7 +48,7 @@ export declare function addTransientObservers(parent: NodeImpl, node: NodeImpl):
|
|
|
49
48
|
export declare function signalSlotChange(slot: NodeImpl): void;
|
|
50
49
|
/** https://dom.spec.whatwg.org/#notify-mutation-observers */
|
|
51
50
|
export declare function notifyMutationObservers(): void;
|
|
52
|
-
/** Notify step 4.3
|
|
53
|
-
export declare function removeTransientRegistrations(mo: MutationObserver): void;
|
|
51
|
+
/** Notify step 4.3 removes all transient registrations. Re-observing a target removes only its transients. */
|
|
52
|
+
export declare function removeTransientRegistrations(mo: MutationObserver, source?: RegisteredObserver): void;
|
|
54
53
|
/** @internal Drop `mo` from the pending list (disconnect). */
|
|
55
54
|
export declare function dropPending(mo: MutationObserver): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Document } from "../nodes/Document.js";
|
|
2
2
|
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
3
|
-
export { parseXML,
|
|
3
|
+
export { parseXML, PARSERERROR_NS } from "./xml.js";
|
|
4
4
|
/** Options for the HTML parser entry points. */
|
|
5
5
|
export interface HTMLParseOptions {
|
|
6
6
|
/** Scripting flag (affects <noscript>). Default false: like jsdom, scripts never run here. */
|
|
@@ -61,6 +61,8 @@ export declare class CList {
|
|
|
61
61
|
export type Matcher = (el: NodeImpl) => boolean;
|
|
62
62
|
/** Results of a compilation besides the program itself. */
|
|
63
63
|
export declare class CompileInfo {
|
|
64
|
+
/** Every selector uses only element types, universal selectors and tree combinators. */
|
|
65
|
+
treeOnly: boolean;
|
|
64
66
|
/** Contains state pseudo-classes whose value is not covered by Document._version. */
|
|
65
67
|
volatile: boolean;
|
|
66
68
|
/** Contains :scope. */
|
|
@@ -81,8 +83,6 @@ export declare class CompileInfo {
|
|
|
81
83
|
forgivingDropped: boolean;
|
|
82
84
|
constructor();
|
|
83
85
|
}
|
|
84
|
-
/** Pack (a, b, c) into one comparable number (each component saturates at 1023). */
|
|
85
|
-
export declare function packSpecificity(a: number, b: number, c: number): number;
|
|
86
86
|
export declare function unpackSpecificity(s: number): [number, number, number];
|
|
87
87
|
/** https://drafts.csswg.org/selectors-4/#specificity-rules */
|
|
88
88
|
export declare function complexSpecificity(cx: Complex): number;
|
|
@@ -4,19 +4,15 @@ import { NodeList } from "../collections/NodeList.js";
|
|
|
4
4
|
export declare function clearSelectorCaches(): void;
|
|
5
5
|
/**
|
|
6
6
|
* The only element with ID `id` under `root` from the document's id index: the element, null when
|
|
7
|
-
* there is none, undefined when the
|
|
8
|
-
*
|
|
7
|
+
* there is none, undefined when the caller must walk. Connected shadow trees also register
|
|
8
|
+
* their IDs. During insertion the subtree is linked before all its IDs have been registered.
|
|
9
9
|
*/
|
|
10
10
|
export declare function indexedDescendantById(root: NodeImpl, id: string): NodeImpl | null | undefined;
|
|
11
11
|
/** https://dom.spec.whatwg.org/#dom-parentnode-queryselector */
|
|
12
12
|
export declare function querySelector(root: NodeImpl, selectors: string): NodeImpl | null;
|
|
13
13
|
/** https://dom.spec.whatwg.org/#dom-parentnode-queryselectorall (static NodeList) */
|
|
14
14
|
export declare function querySelectorAll(root: NodeImpl, selectors: string): NodeList;
|
|
15
|
-
/** Internal variant of querySelectorAll returning impls (no NodeList allocation). The array is fresh and owned by the caller. */
|
|
16
|
-
export declare function querySelectorAllImpls(root: NodeImpl, selectors: string, out?: NodeImpl[]): NodeImpl[];
|
|
17
15
|
/** https://dom.spec.whatwg.org/#dom-element-matches */
|
|
18
16
|
export declare function matches(el: NodeImpl, selectors: string): boolean;
|
|
19
17
|
/** https://dom.spec.whatwg.org/#dom-element-closest */
|
|
20
18
|
export declare function closest(el: NodeImpl, selectors: string): NodeImpl | null;
|
|
21
|
-
/** Whether `selectors` parses as a valid selector list (no exception). */
|
|
22
|
-
export declare function isValidSelector(selectors: string): boolean;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { NodeImpl } from "../nodes/NodeImpl.js";
|
|
2
2
|
import { type NamespaceContext } from "./serialize.js";
|
|
3
|
-
import { type CComplex, CompileInfo, KEY_CLASS, KEY_ID, KEY_NONE, KEY_TAG,
|
|
3
|
+
import { type CComplex, CompileInfo, KEY_CLASS, KEY_ID, KEY_NONE, KEY_TAG, unpackSpecificity } from "./compile.js";
|
|
4
4
|
import { $cx, $info } from "../keys.js";
|
|
5
|
-
export { KEY_NONE, KEY_ID, KEY_CLASS, KEY_TAG,
|
|
5
|
+
export { KEY_NONE, KEY_ID, KEY_CLASS, KEY_TAG, unpackSpecificity };
|
|
6
6
|
export { buildAncestorFilter, mayMatchAncestors } from "./filter.js";
|
|
7
7
|
export { beginStateDeps, endStateDeps, stateDepsHold, type StateDeps } from "./compile.js";
|
|
8
|
-
export {
|
|
9
|
-
export { setHoverTarget, setActiveTarget, setPseudoClassPredicate, interaction, type Predicate } from "./state.js";
|
|
8
|
+
export { setHoverTarget, setActiveTarget } from "./state.js";
|
|
10
9
|
/** One complex selector of a compiled list. */
|
|
11
10
|
export declare class CompiledSelector {
|
|
12
11
|
/** Source text of this complex selector (trimmed). */
|
|
@@ -83,7 +82,5 @@ export declare function matchesSelector(sel: CompiledSelector, el: NodeImpl, pse
|
|
|
83
82
|
* (`direct`) run their matcher without the save/restore and try/finally.
|
|
84
83
|
*/
|
|
85
84
|
export declare function matchesSelectorDirect(sel: CompiledSelector, el: NodeImpl, pseudoElement: string): boolean;
|
|
86
|
-
/** Whether any selector of the list matches. */
|
|
87
|
-
export declare function matchesSelectorList(list: CompiledSelectorList, el: NodeImpl, pseudoElement?: string | null, options?: MatchOptions): boolean;
|
|
88
85
|
/** Highest specificity among the selectors of `list` that match `el` (-1 when none match). */
|
|
89
86
|
export declare function matchingSpecificity(list: CompiledSelectorList, el: NodeImpl, pseudoElement?: string | null, options?: MatchOptions): number;
|
|
@@ -136,7 +136,6 @@ export declare const P_HOST = 29;
|
|
|
136
136
|
export declare const P_LINK = 30;
|
|
137
137
|
export declare const P_ANY_LINK = 31;
|
|
138
138
|
export declare const P_VISITED = 32;
|
|
139
|
-
export declare const P_LOCAL_LINK = 33;
|
|
140
139
|
export declare const P_TARGET = 34;
|
|
141
140
|
export declare const P_TARGET_WITHIN = 35;
|
|
142
141
|
export declare const P_DEFINED = 36;
|
|
@@ -162,9 +161,7 @@ export declare const P_OUT_OF_RANGE = 63;
|
|
|
162
161
|
export declare const P_USER_VALID = 64;
|
|
163
162
|
export declare const P_USER_INVALID = 65;
|
|
164
163
|
export declare const P_AUTOFILL = 66;
|
|
165
|
-
export declare const P_BLANK = 67;
|
|
166
164
|
export declare const P_OPEN = 70;
|
|
167
|
-
export declare const P_CLOSED = 71;
|
|
168
165
|
export declare const P_POPOVER_OPEN = 72;
|
|
169
166
|
export declare const P_MODAL = 73;
|
|
170
167
|
export declare const P_FULLSCREEN = 74;
|
|
@@ -306,5 +303,3 @@ export declare class SelectorParser {
|
|
|
306
303
|
}
|
|
307
304
|
/** Parse a selector list; returns null (with `parser.error` set) when invalid. */
|
|
308
305
|
export declare function parseSelectorList(src: string): SelectorList | null;
|
|
309
|
-
/** Like `parseSelectorList` but returns the failure reason ("" on success). */
|
|
310
|
-
export declare function selectorError(src: string): string;
|
|
@@ -36,8 +36,3 @@ export declare function directionality(el: NodeImpl): number;
|
|
|
36
36
|
* compilations (call `clearSelectorCaches()` after registering if that matters).
|
|
37
37
|
*/
|
|
38
38
|
export declare const predicates: Record<string, Predicate>;
|
|
39
|
-
/**
|
|
40
|
-
* Replace the predicate for an element-state pseudo-class (e.g. html-forms registers `checked`,
|
|
41
|
-
* html-elements registers `focus`, `popover-open`, `defined`). Name without the colon.
|
|
42
|
-
*/
|
|
43
|
-
export declare function setPseudoClassPredicate(name: string, fn: Predicate): void;
|
|
@@ -19,8 +19,6 @@ export interface GetHTMLOptions {
|
|
|
19
19
|
* (always the HTML fragment serialization algorithm). `shadowRoots` holds ShadowRoot wrappers.
|
|
20
20
|
*/
|
|
21
21
|
export declare function getHTML(node: NodeImpl, options?: GetHTMLOptions): string;
|
|
22
|
-
/** HTML fragment serialization of `node`'s children, regardless of the document type. */
|
|
23
|
-
export declare function serializeHTMLChildren(node: NodeImpl): string;
|
|
24
22
|
/**
|
|
25
23
|
* https://w3c.github.io/DOM-Parsing/#dfn-concept-serialize-xml — throws an
|
|
26
24
|
* "InvalidStateError" DOMException when `requireWellFormed` and the node cannot be serialized.
|
|
@@ -13,7 +13,7 @@ export declare function nodeLength(n: NodeImpl): number;
|
|
|
13
13
|
/**
|
|
14
14
|
* Position of boundary point (a, oa) relative to (b, ob): -1 before, 0 equal, 1 after.
|
|
15
15
|
* https://dom.spec.whatwg.org/#concept-range-bp-position — computed from the two ancestor
|
|
16
|
-
* chains
|
|
16
|
+
* chains and sibling links. The points must share a root.
|
|
17
17
|
*/
|
|
18
18
|
export declare function compareBoundaryPoints(a: NodeImpl, oa: number, b: NodeImpl, ob: number): number;
|
|
19
19
|
/** https://dom.spec.whatwg.org/#interface-abstractrange */
|
|
@@ -80,8 +80,6 @@ export declare class Range extends AbstractRange {
|
|
|
80
80
|
selectNodeContents(node: Node): void;
|
|
81
81
|
/** https://dom.spec.whatwg.org/#dom-range-compareboundarypoints */
|
|
82
82
|
compareBoundaryPoints(how: number, sourceRange: Range): number;
|
|
83
|
-
/** https://dom.spec.whatwg.org/#contained */
|
|
84
|
-
_contains(n: NodeImpl): boolean;
|
|
85
83
|
/** https://dom.spec.whatwg.org/#dom-range-deletecontents */
|
|
86
84
|
deleteContents(): void;
|
|
87
85
|
/** https://dom.spec.whatwg.org/#dom-range-extractcontents */
|
|
@@ -29,6 +29,12 @@ export declare function markBoundary(n: NodeImpl): void;
|
|
|
29
29
|
/** Sets F_RANGE_BELOW on `n` and its ancestors (stops at the first one that has it). */
|
|
30
30
|
export declare function markRangeAncestors(n: NodeImpl): void;
|
|
31
31
|
export declare function registerLiveRange(r: LiveBoundaries): void;
|
|
32
|
+
/**
|
|
33
|
+
* `r` is unreachable: its only holder (a Selection that made it and never handed it out) has
|
|
34
|
+
* replaced it. The next walk of its document's list drops the entry instead of waiting for a
|
|
35
|
+
* major GC to clear the WeakRef, so selections moved in a loop do not lengthen every mutation.
|
|
36
|
+
*/
|
|
37
|
+
export declare function retireLiveRange(r: LiveBoundaries): void;
|
|
32
38
|
/** Re-file `r` after its boundary points moved to another document. */
|
|
33
39
|
export declare function refileRange(r: LiveBoundaries): void;
|
|
34
40
|
export declare function registerNodeIterator(it: IteratorState): void;
|
|
@@ -38,9 +44,9 @@ export declare function registerNodeIterator(it: IteratorState): void;
|
|
|
38
44
|
*/
|
|
39
45
|
export declare function rangesAdopt(node: NodeImpl, oldDoc: object): void;
|
|
40
46
|
/** https://dom.spec.whatwg.org/#concept-node-insert step 2 */
|
|
41
|
-
export declare function rangesAfterInsert(parent: NodeImpl,
|
|
47
|
+
export declare function rangesAfterInsert(parent: NodeImpl, child: NodeImpl, count: number): void;
|
|
42
48
|
/** https://dom.spec.whatwg.org/#concept-node-remove steps 4-7 */
|
|
43
|
-
export declare function rangesBeforeRemove(node: NodeImpl, parent: NodeImpl
|
|
49
|
+
export declare function rangesBeforeRemove(node: NodeImpl, parent: NodeImpl): void;
|
|
44
50
|
/** https://dom.spec.whatwg.org/#concept-cd-replace steps 8-11 */
|
|
45
51
|
export declare function rangesReplaceData(node: NodeImpl, offset: number, count: number, dataLength: number): void;
|
|
46
52
|
/** https://dom.spec.whatwg.org/#concept-text-split steps 7.2-7.5 */
|
|
@@ -49,5 +55,3 @@ export declare function rangesSplitText(node: NodeImpl, newNode: NodeImpl, offse
|
|
|
49
55
|
export declare function rangesNormalizeMerge(node: NodeImpl, current: NodeImpl, length: number): void;
|
|
50
56
|
/** https://dom.spec.whatwg.org/#nodeiterator-pre-removing-steps (for every iterator in node's document). */
|
|
51
57
|
export declare function iteratorsBeforeRemove(toBeRemoved: NodeImpl): void;
|
|
52
|
-
/** @internal For tests: drop every registration. */
|
|
53
|
-
export declare function _resetLiveRegistries(): void;
|
|
@@ -12,5 +12,3 @@ export declare function toUnsignedLong(v: unknown): number;
|
|
|
12
12
|
export declare function toShort(v: unknown): number;
|
|
13
13
|
/** https://webidl.spec.whatwg.org/#es-unsigned-short */
|
|
14
14
|
export declare function toUnsignedShort(v: unknown): number;
|
|
15
|
-
/** A dictionary argument: undefined/null → null (use defaults), objects pass, others throw. */
|
|
16
|
-
export declare function toDictionary(v: unknown, iface: string): Record<string, unknown> | null;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { EventTarget } from "../events/EventTarget.js";
|
|
2
2
|
import { $error, $generation, $readyState, $result } from "../keys.js";
|
|
3
3
|
type ReadKind = "ArrayBuffer" | "BinaryString" | "Text" | "DataURL";
|
|
4
|
+
interface ReadOperation {
|
|
5
|
+
reader: FileReader | null;
|
|
6
|
+
source: Blob | null;
|
|
7
|
+
}
|
|
4
8
|
export declare class FileReader extends EventTarget {
|
|
5
9
|
static readonly EMPTY = 0;
|
|
6
10
|
static readonly LOADING = 1;
|
|
@@ -8,8 +12,8 @@ export declare class FileReader extends EventTarget {
|
|
|
8
12
|
[$readyState]: number;
|
|
9
13
|
[$result]: string | ArrayBuffer | null;
|
|
10
14
|
[$error]: DOMException | null;
|
|
11
|
-
/**
|
|
12
|
-
[$generation]:
|
|
15
|
+
/** Abort disconnects pending byte callbacks from this reader and its source. */
|
|
16
|
+
[$generation]: ReadOperation | null;
|
|
13
17
|
constructor();
|
|
14
18
|
get readyState(): number;
|
|
15
19
|
get result(): string | ArrayBuffer | null;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import type { Window } from "./Window.js";
|
|
2
2
|
/** https://storage.spec.whatwg.org/#storage-shed */
|
|
3
|
-
export
|
|
3
|
+
export declare class StorageShed {
|
|
4
4
|
/** origin → local storage area (a "storage bottle map") */
|
|
5
|
-
areas: Map<string,
|
|
6
|
-
windows: Set<
|
|
5
|
+
readonly areas: Map<string, StorageArea>;
|
|
6
|
+
readonly windows: Set<StoragePeer>;
|
|
7
|
+
readonly collected: FinalizationRegistry<StoragePeer>;
|
|
8
|
+
}
|
|
9
|
+
/** A shared storage area can broadcast to a tab for as long as the tab is reachable. */
|
|
10
|
+
export declare class StoragePeer extends WeakRef<Window> {
|
|
11
|
+
readonly shed: StorageShed;
|
|
12
|
+
constructor(window: Window, shed?: StorageShed);
|
|
13
|
+
leave(): void;
|
|
14
|
+
}
|
|
15
|
+
/** Shared quota usage in UTF-16 code units, including keys and values. */
|
|
16
|
+
declare class StorageArea extends Map<string, string> {
|
|
17
|
+
codeUnits: number;
|
|
7
18
|
}
|
|
8
|
-
export declare function createStorageShed(): StorageShed;
|
|
9
19
|
export declare class Storage {
|
|
10
|
-
constructor(token?: symbol, window?: Window, type?: "local" | "session", map?:
|
|
20
|
+
constructor(token?: symbol, window?: Window, type?: "local" | "session", map?: StorageArea);
|
|
11
21
|
/** https://html.spec.whatwg.org/#dom-storage-length */
|
|
12
22
|
get length(): number;
|
|
13
23
|
/** https://html.spec.whatwg.org/#dom-storage-key */
|
|
@@ -26,3 +36,4 @@ export declare class Storage {
|
|
|
26
36
|
export declare function createLocalStorage(window: Window): Storage;
|
|
27
37
|
/** @internal Create a window's sessionStorage: shared with same-origin frames of its top-level window. */
|
|
28
38
|
export declare function createSessionStorage(window: Window): Storage;
|
|
39
|
+
export {};
|