happy-dom 13.3.0 → 13.3.2
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.
Potentially problematic release.
This version of happy-dom might be problematic. Click here for more details.
- package/README.md +4 -0
- package/cjs/css/declaration/property-manager/CSSStyleDeclarationPropertySetParser.cjs.map +1 -1
- package/cjs/fetch/Fetch.cjs.map +1 -1
- package/cjs/fetch/Fetch.d.ts.map +1 -1
- package/cjs/fetch/SyncFetch.cjs.map +1 -1
- package/cjs/fetch/SyncFetch.d.ts.map +1 -1
- package/cjs/file/FileReader.cjs +2 -1
- package/cjs/file/FileReader.cjs.map +1 -1
- package/cjs/file/FileReader.d.ts.map +1 -1
- package/cjs/match-media/MediaQueryParser.cjs.map +1 -1
- package/cjs/nodes/node/NodeUtility.cjs.map +1 -1
- package/cjs/range/Range.cjs.map +1 -1
- package/cjs/version.cjs +1 -1
- package/lib/css/declaration/property-manager/CSSStyleDeclarationPropertySetParser.js.map +1 -1
- package/lib/fetch/Fetch.d.ts.map +1 -1
- package/lib/fetch/Fetch.js.map +1 -1
- package/lib/fetch/SyncFetch.d.ts.map +1 -1
- package/lib/fetch/SyncFetch.js.map +1 -1
- package/lib/file/FileReader.d.ts.map +1 -1
- package/lib/file/FileReader.js +2 -1
- package/lib/file/FileReader.js.map +1 -1
- package/lib/match-media/MediaQueryParser.js.map +1 -1
- package/lib/nodes/node/NodeUtility.js.map +1 -1
- package/lib/range/Range.js.map +1 -1
- package/lib/version.js +1 -1
- package/package.json +86 -86
- package/src/css/declaration/property-manager/CSSStyleDeclarationPropertySetParser.ts +6 -6
- package/src/fetch/Fetch.ts +1 -5
- package/src/fetch/SyncFetch.ts +1 -5
- package/src/file/FileReader.ts +2 -3
- package/src/match-media/MediaQueryParser.ts +2 -2
- package/src/nodes/node/NodeUtility.ts +2 -2
- package/src/range/Range.ts +2 -2
package/package.json
CHANGED
@@ -1,93 +1,93 @@
|
|
1
1
|
{
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
},
|
17
|
-
"./lib/*.js": {
|
18
|
-
"import": "./lib/*.js",
|
19
|
-
"require": "./cjs/*.cjs",
|
20
|
-
"default": "./lib/*.js"
|
21
|
-
},
|
22
|
-
"./lib/*.ts": {
|
23
|
-
"import": "./lib/*.ts",
|
24
|
-
"require": "./cjs/*.ts",
|
25
|
-
"default": "./lib/*.ts"
|
26
|
-
},
|
27
|
-
"./lib/*.map": {
|
28
|
-
"import": "./lib/*.map",
|
29
|
-
"require": "./cjs/*.map",
|
30
|
-
"default": "./lib/*.map"
|
31
|
-
},
|
32
|
-
"./cjs/*.cjs": {
|
33
|
-
"import": "./cjs/*.cjs",
|
34
|
-
"require": "./cjs/*.cjs",
|
35
|
-
"default": "./cjs/*.cjs"
|
36
|
-
},
|
37
|
-
"./cjs/*.ts": {
|
38
|
-
"import": "./cjs/*.ts",
|
39
|
-
"require": "./cjs/*.ts",
|
40
|
-
"default": "./cjs/*.ts"
|
41
|
-
},
|
42
|
-
"./cjs/*.map": {
|
43
|
-
"import": "./cjs/*.map",
|
44
|
-
"require": "./cjs/*.map",
|
45
|
-
"default": "./cjs/*.map"
|
46
|
-
},
|
47
|
-
"./src/*.ts": "./src/*.ts",
|
48
|
-
"./package.json": "./package.json",
|
49
|
-
"./.eslintrc.cjs": "./.eslintrc.cjs",
|
50
|
-
"./.prettierrc.cjs": "./.prettierrc.cjs"
|
2
|
+
"name": "happy-dom",
|
3
|
+
"version": "13.3.2",
|
4
|
+
"license": "MIT",
|
5
|
+
"homepage": "https://github.com/capricorn86/happy-dom",
|
6
|
+
"repository": "https://github.com/capricorn86/happy-dom",
|
7
|
+
"author": "David Ortner",
|
8
|
+
"description": "Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.",
|
9
|
+
"main": "lib/index.js",
|
10
|
+
"type": "module",
|
11
|
+
"exports": {
|
12
|
+
".": {
|
13
|
+
"import": "./lib/index.js",
|
14
|
+
"require": "./cjs/index.cjs",
|
15
|
+
"default": "./lib/index.js"
|
51
16
|
},
|
52
|
-
"
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
"custom",
|
57
|
-
"elements",
|
58
|
-
"web",
|
59
|
-
"components",
|
60
|
-
"html",
|
61
|
-
"whatwg",
|
62
|
-
"w3c"
|
63
|
-
],
|
64
|
-
"publishConfig": {
|
65
|
-
"access": "public"
|
17
|
+
"./lib/*.js": {
|
18
|
+
"import": "./lib/*.js",
|
19
|
+
"require": "./cjs/*.cjs",
|
20
|
+
"default": "./lib/*.js"
|
66
21
|
},
|
67
|
-
"
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
"watch": "tsc -w --preserveWatchOutput",
|
72
|
-
"test": "vitest run --singleThread",
|
73
|
-
"test:ui": "vitest --ui",
|
74
|
-
"test:watch": "vitest --singleThread",
|
75
|
-
"test:debug": "vitest run --inspect-brk --threads=false"
|
22
|
+
"./lib/*.ts": {
|
23
|
+
"import": "./lib/*.ts",
|
24
|
+
"require": "./cjs/*.ts",
|
25
|
+
"default": "./lib/*.ts"
|
76
26
|
},
|
77
|
-
"
|
78
|
-
|
79
|
-
|
80
|
-
|
27
|
+
"./lib/*.map": {
|
28
|
+
"import": "./lib/*.map",
|
29
|
+
"require": "./cjs/*.map",
|
30
|
+
"default": "./lib/*.map"
|
81
31
|
},
|
82
|
-
"
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
"prettier": "^2.6.0",
|
87
|
-
"typescript": "^5.0.4",
|
88
|
-
"vitest": "^0.32.4"
|
32
|
+
"./cjs/*.cjs": {
|
33
|
+
"import": "./cjs/*.cjs",
|
34
|
+
"require": "./cjs/*.cjs",
|
35
|
+
"default": "./cjs/*.cjs"
|
89
36
|
},
|
90
|
-
"
|
91
|
-
|
92
|
-
|
37
|
+
"./cjs/*.ts": {
|
38
|
+
"import": "./cjs/*.ts",
|
39
|
+
"require": "./cjs/*.ts",
|
40
|
+
"default": "./cjs/*.ts"
|
41
|
+
},
|
42
|
+
"./cjs/*.map": {
|
43
|
+
"import": "./cjs/*.map",
|
44
|
+
"require": "./cjs/*.map",
|
45
|
+
"default": "./cjs/*.map"
|
46
|
+
},
|
47
|
+
"./src/*.ts": "./src/*.ts",
|
48
|
+
"./package.json": "./package.json",
|
49
|
+
"./.eslintrc.cjs": "./.eslintrc.cjs",
|
50
|
+
"./.prettierrc.cjs": "./.prettierrc.cjs"
|
51
|
+
},
|
52
|
+
"keywords": [
|
53
|
+
"jsdom",
|
54
|
+
"dom",
|
55
|
+
"browser",
|
56
|
+
"custom",
|
57
|
+
"elements",
|
58
|
+
"web",
|
59
|
+
"components",
|
60
|
+
"html",
|
61
|
+
"whatwg",
|
62
|
+
"w3c"
|
63
|
+
],
|
64
|
+
"publishConfig": {
|
65
|
+
"access": "public"
|
66
|
+
},
|
67
|
+
"scripts": {
|
68
|
+
"compile": "tsc && rm -rf ./cjs && tsc --moduleResolution Node --module CommonJS --outDir cjs && npm run change-cjs-file-extension && npm run build-version-file",
|
69
|
+
"change-cjs-file-extension": "node ./bin/change-file-extension.cjs --dir=./cjs --fromExt=.js --toExt=.cjs",
|
70
|
+
"build-version-file": "node ./bin/build-version-file.cjs",
|
71
|
+
"watch": "tsc -w --preserveWatchOutput",
|
72
|
+
"test": "vitest run --singleThread",
|
73
|
+
"test:ui": "vitest --ui",
|
74
|
+
"test:watch": "vitest --singleThread",
|
75
|
+
"test:debug": "vitest run --inspect-brk --threads=false"
|
76
|
+
},
|
77
|
+
"dependencies": {
|
78
|
+
"entities": "^4.5.0",
|
79
|
+
"webidl-conversions": "^7.0.0",
|
80
|
+
"whatwg-mimetype": "^3.0.0"
|
81
|
+
},
|
82
|
+
"devDependencies": {
|
83
|
+
"@types/node": "^16.11.7",
|
84
|
+
"@vitest/ui": "^0.33.0",
|
85
|
+
"@webref/css": "6.6.2",
|
86
|
+
"prettier": "^2.6.0",
|
87
|
+
"typescript": "^5.0.4",
|
88
|
+
"vitest": "^0.32.4"
|
89
|
+
},
|
90
|
+
"engines": {
|
91
|
+
"node": ">=16.0.0"
|
92
|
+
}
|
93
93
|
}
|
@@ -533,7 +533,7 @@ export default class CSSStyleDeclarationPropertySetParser {
|
|
533
533
|
return color
|
534
534
|
? {
|
535
535
|
'outline-color': { value: color, important }
|
536
|
-
|
536
|
+
}
|
537
537
|
: null;
|
538
538
|
}
|
539
539
|
|
@@ -1417,7 +1417,7 @@ export default class CSSStyleDeclarationPropertySetParser {
|
|
1417
1417
|
return color
|
1418
1418
|
? {
|
1419
1419
|
'border-top-color': { value: color, important }
|
1420
|
-
|
1420
|
+
}
|
1421
1421
|
: null;
|
1422
1422
|
}
|
1423
1423
|
|
@@ -1445,7 +1445,7 @@ export default class CSSStyleDeclarationPropertySetParser {
|
|
1445
1445
|
return color
|
1446
1446
|
? {
|
1447
1447
|
'border-right-color': { value: color, important }
|
1448
|
-
|
1448
|
+
}
|
1449
1449
|
: null;
|
1450
1450
|
}
|
1451
1451
|
|
@@ -1473,7 +1473,7 @@ export default class CSSStyleDeclarationPropertySetParser {
|
|
1473
1473
|
return color
|
1474
1474
|
? {
|
1475
1475
|
'border-bottom-color': { value: color, important }
|
1476
|
-
|
1476
|
+
}
|
1477
1477
|
: null;
|
1478
1478
|
}
|
1479
1479
|
|
@@ -1501,7 +1501,7 @@ export default class CSSStyleDeclarationPropertySetParser {
|
|
1501
1501
|
return color
|
1502
1502
|
? {
|
1503
1503
|
'border-left-color': { value: color, important }
|
1504
|
-
|
1504
|
+
}
|
1505
1505
|
: null;
|
1506
1506
|
}
|
1507
1507
|
|
@@ -2769,7 +2769,7 @@ export default class CSSStyleDeclarationPropertySetParser {
|
|
2769
2769
|
return color
|
2770
2770
|
? {
|
2771
2771
|
['background-color']: { important, value: color }
|
2772
|
-
|
2772
|
+
}
|
2773
2773
|
: null;
|
2774
2774
|
}
|
2775
2775
|
|
package/src/fetch/Fetch.ts
CHANGED
@@ -120,11 +120,7 @@ export default class Fetch {
|
|
120
120
|
this.#window.location.protocol === 'https:'
|
121
121
|
) {
|
122
122
|
throw new DOMException(
|
123
|
-
`Mixed Content: The page at '${
|
124
|
-
this.#window.location.href
|
125
|
-
}' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '${
|
126
|
-
this.request.url
|
127
|
-
}'. This request has been blocked; the content must be served over HTTPS.`,
|
123
|
+
`Mixed Content: The page at '${this.#window.location.href}' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '${this.request.url}'. This request has been blocked; the content must be served over HTTPS.`,
|
128
124
|
DOMExceptionNameEnum.securityError
|
129
125
|
);
|
130
126
|
}
|
package/src/fetch/SyncFetch.ts
CHANGED
@@ -112,11 +112,7 @@ export default class SyncFetch {
|
|
112
112
|
this.#window.location.protocol === 'https:'
|
113
113
|
) {
|
114
114
|
throw new DOMException(
|
115
|
-
`Mixed Content: The page at '${
|
116
|
-
this.#window.location.href
|
117
|
-
}' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '${
|
118
|
-
this.request.url
|
119
|
-
}'. This request has been blocked; the content must be served over HTTPS.`,
|
115
|
+
`Mixed Content: The page at '${this.#window.location.href}' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '${this.request.url}'. This request has been blocked; the content must be served over HTTPS.`,
|
120
116
|
DOMExceptionNameEnum.securityError
|
121
117
|
);
|
122
118
|
}
|
package/src/file/FileReader.ts
CHANGED
@@ -162,9 +162,8 @@ export default class FileReader extends EventTarget {
|
|
162
162
|
case FileReaderFormatEnum.dataURL: {
|
163
163
|
// Spec seems very unclear here; see https://github.com/w3c/FileAPI/issues/104.
|
164
164
|
const contentType = WhatwgMIMEType.parse(blob.type) || 'application/octet-stream';
|
165
|
-
(<Buffer | ArrayBuffer | string>
|
166
|
-
|
167
|
-
)) = `data:${contentType};base64,${data.toString('base64')}`;
|
165
|
+
(<Buffer | ArrayBuffer | string>this.result) =
|
166
|
+
`data:${contentType};base64,${data.toString('base64')}`;
|
168
167
|
break;
|
169
168
|
}
|
170
169
|
case FileReaderFormatEnum.text: {
|
@@ -77,14 +77,14 @@ export default class MediaQueryParser {
|
|
77
77
|
? {
|
78
78
|
value: resolutionMatch[1],
|
79
79
|
operator: resolutionMatch[2]
|
80
|
-
|
80
|
+
}
|
81
81
|
: null,
|
82
82
|
type: resolutionMatch[3],
|
83
83
|
after: resolutionMatch[5]
|
84
84
|
? {
|
85
85
|
value: resolutionMatch[5],
|
86
86
|
operator: resolutionMatch[4]
|
87
|
-
|
87
|
+
}
|
88
88
|
: null
|
89
89
|
});
|
90
90
|
} else {
|
@@ -290,8 +290,8 @@ export default class NodeUtility {
|
|
290
290
|
parent = parent[PropertySymbol.parentNode]
|
291
291
|
? parent[PropertySymbol.parentNode]
|
292
292
|
: includeShadowRoots && (<IShadowRoot>parent).host
|
293
|
-
|
294
|
-
|
293
|
+
? (<IShadowRoot>parent).host
|
294
|
+
: null;
|
295
295
|
}
|
296
296
|
|
297
297
|
return false;
|
package/src/range/Range.ts
CHANGED
@@ -811,7 +811,7 @@ export default class Range {
|
|
811
811
|
this[PropertySymbol.start].node[PropertySymbol.nodeType] === NodeTypeEnum.textNode
|
812
812
|
? this[PropertySymbol.start].node
|
813
813
|
: (<Node>this[PropertySymbol.start].node)[PropertySymbol.childNodes][this.startOffset] ||
|
814
|
-
|
814
|
+
null;
|
815
815
|
const parent = !referenceNode
|
816
816
|
? this[PropertySymbol.start].node
|
817
817
|
: referenceNode[PropertySymbol.parentNode];
|
@@ -833,7 +833,7 @@ export default class Range {
|
|
833
833
|
? NodeUtility.getNodeLength(parent)
|
834
834
|
: (<Node>referenceNode[PropertySymbol.parentNode])[PropertySymbol.childNodes].indexOf(
|
835
835
|
referenceNode
|
836
|
-
|
836
|
+
);
|
837
837
|
newOffset +=
|
838
838
|
newNode[PropertySymbol.nodeType] === NodeTypeEnum.documentFragmentNode
|
839
839
|
? NodeUtility.getNodeLength(newNode)
|