@siteimprove/alfa-dom 0.89.4 → 0.90.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @siteimprove/alfa-dom
2
2
 
3
+ ## 0.90.1
4
+
5
+ ### Patch Changes
6
+
7
+ - **Added:** `Navive.fromNode` can now be called with no argument, in which case it will default to `window.document`. ([#1678](https://github.com/Siteimprove/alfa/pull/1678))
8
+
9
+ It is not possible to provide options this way.
10
+
11
+ This is useful in settings where the serialisation must be injected into another context (e.g. headless browser), to avoid specifically fetching the document or using a bundler to inject `() => Native.fromNode(window.document)` to read it from inside the other context.
12
+
13
+ ## 0.90.0
14
+
3
15
  ## 0.89.3
4
16
 
5
17
  ## 0.89.2
package/dist/native.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare namespace Native {
7
7
  function fromNode(node: globalThis.Attr, options?: Options): Promise<Attribute.JSON>;
8
8
  function fromNode(node: globalThis.Text, options?: Options): Promise<Text.JSON>;
9
9
  function fromNode(node: globalThis.Comment, options?: Options): Promise<Comment.JSON>;
10
- function fromNode(node: globalThis.Document, options?: Options): Promise<Document.JSON>;
10
+ function fromNode(node?: globalThis.Document, options?: Options): Promise<Document.JSON>;
11
11
  function fromNode(node: globalThis.DocumentType, options?: Options): Promise<Type.JSON>;
12
12
  function fromNode(node: globalThis.Node, options?: Options): Promise<Node.JSON>;
13
13
  interface Options {
package/dist/native.js CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export var Native;
6
6
  (function (Native) {
7
- async function fromNode(node, options) {
7
+ async function fromNode(node = window.document, options) {
8
8
  const { withCrossOrigin = false } = options ?? {};
9
9
  return toNode(node);
10
10
  async function toNode(node) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/package",
3
3
  "name": "@siteimprove/alfa-dom",
4
4
  "homepage": "https://alfa.siteimprove.com",
5
- "version": "0.89.4",
5
+ "version": "0.90.1",
6
6
  "license": "MIT",
7
7
  "description": "Implementations of the core DOM and CSSOM node types",
8
8
  "repository": {
@@ -33,32 +33,32 @@
33
33
  "dist/**/*.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@siteimprove/alfa-array": "^0.89.4",
37
- "@siteimprove/alfa-cache": "^0.89.4",
38
- "@siteimprove/alfa-comparable": "^0.89.4",
39
- "@siteimprove/alfa-css": "^0.89.4",
40
- "@siteimprove/alfa-css-feature": "^0.89.4",
41
- "@siteimprove/alfa-device": "^0.89.4",
42
- "@siteimprove/alfa-earl": "^0.89.4",
43
- "@siteimprove/alfa-equatable": "^0.89.4",
44
- "@siteimprove/alfa-flags": "^0.89.4",
45
- "@siteimprove/alfa-iterable": "^0.89.4",
46
- "@siteimprove/alfa-json": "^0.89.4",
47
- "@siteimprove/alfa-lazy": "^0.89.4",
48
- "@siteimprove/alfa-map": "^0.89.4",
49
- "@siteimprove/alfa-option": "^0.89.4",
50
- "@siteimprove/alfa-predicate": "^0.89.4",
51
- "@siteimprove/alfa-rectangle": "^0.89.4",
52
- "@siteimprove/alfa-refinement": "^0.89.4",
53
- "@siteimprove/alfa-sarif": "^0.89.4",
54
- "@siteimprove/alfa-selective": "^0.89.4",
55
- "@siteimprove/alfa-sequence": "^0.89.4",
56
- "@siteimprove/alfa-string": "^0.89.4",
57
- "@siteimprove/alfa-trampoline": "^0.89.4",
58
- "@siteimprove/alfa-tree": "^0.89.4"
36
+ "@siteimprove/alfa-array": "^0.90.1",
37
+ "@siteimprove/alfa-cache": "^0.90.1",
38
+ "@siteimprove/alfa-comparable": "^0.90.1",
39
+ "@siteimprove/alfa-css": "^0.90.1",
40
+ "@siteimprove/alfa-css-feature": "^0.90.1",
41
+ "@siteimprove/alfa-device": "^0.90.1",
42
+ "@siteimprove/alfa-earl": "^0.90.1",
43
+ "@siteimprove/alfa-equatable": "^0.90.1",
44
+ "@siteimprove/alfa-flags": "^0.90.1",
45
+ "@siteimprove/alfa-iterable": "^0.90.1",
46
+ "@siteimprove/alfa-json": "^0.90.1",
47
+ "@siteimprove/alfa-lazy": "^0.90.1",
48
+ "@siteimprove/alfa-map": "^0.90.1",
49
+ "@siteimprove/alfa-option": "^0.90.1",
50
+ "@siteimprove/alfa-predicate": "^0.90.1",
51
+ "@siteimprove/alfa-rectangle": "^0.90.1",
52
+ "@siteimprove/alfa-refinement": "^0.90.1",
53
+ "@siteimprove/alfa-sarif": "^0.90.1",
54
+ "@siteimprove/alfa-selective": "^0.90.1",
55
+ "@siteimprove/alfa-sequence": "^0.90.1",
56
+ "@siteimprove/alfa-string": "^0.90.1",
57
+ "@siteimprove/alfa-trampoline": "^0.90.1",
58
+ "@siteimprove/alfa-tree": "^0.90.1"
59
59
  },
60
60
  "devDependencies": {
61
- "@siteimprove/alfa-test": "^0.89.4",
61
+ "@siteimprove/alfa-test": "^0.90.1",
62
62
  "@types/jsdom": "^21.1.6",
63
63
  "jsdom": "^25.0.0"
64
64
  },