@xmldom/xmldom 0.8.10 → 0.9.0-beta.10

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
@@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.9.0-beta.10](https://github.com/xmldom/xmldom/compare/0.9.0-beta.9...0.9.0-beta.10)
8
+
9
+ ### Fixed
10
+
11
+ - dom: prevent iteration over deleted items [`#514`](https://github.com/xmldom/xmldom/pull/514)/ [`#499`](https://github.com/xmldom/xmldom/issues/499)
12
+
13
+ ### Chore
14
+
15
+ - use prettier plugin for jsdoc [`#513`](https://github.com/xmldom/xmldom/pull/513)
16
+
17
+ Thank you, [@qtow](https://github.com/qtow), [@shunkica](https://github.com/shunkica), [@homer0](https://github.com/homer0), for your contributions
18
+
19
+
7
20
  ## [0.8.10](https://github.com/xmldom/xmldom/compare/0.8.9...0.8.10)
8
21
 
9
22
  ### Fixed
@@ -13,6 +26,32 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
13
26
  Thank you, [@qtow](https://github.com/qtow), for your contributions
14
27
 
15
28
 
29
+ ## [0.7.13](https://github.com/xmldom/xmldom/compare/0.7.12...0.7.13)
30
+
31
+ ### Fixed
32
+
33
+ - dom: prevent iteration over deleted items [`#514`](https://github.com/xmldom/xmldom/pull/514)/ [`#499`](https://github.com/xmldom/xmldom/issues/499)
34
+
35
+ Thank you, [@qtow](https://github.com/qtow), for your contributions
36
+
37
+
38
+ ## [0.9.0-beta.9](https://github.com/xmldom/xmldom/compare/0.9.0-beta.8...0.9.0-beta.9)
39
+
40
+ ### Fixed
41
+
42
+ - Set nodeName property in ProcessingInstruction [`#509`](https://github.com/xmldom/xmldom/pull/509) / [`#505`](https://github.com/xmldom/xmldom/issues/505)
43
+ - preserve DOCTYPE internal subset [`#498`](https://github.com/xmldom/xmldom/pull/498) / [`#497`](https://github.com/xmldom/xmldom/pull/497) / [`#117`](https://github.com/xmldom/xmldom/issues/117)\
44
+ BREAKING CHANGES: Many documents that were previously accepted by xmldom, esecially non well-formed ones are no longer accepted. Some issues that were formerly reported as errors are now a fatalError.
45
+ - DOMParser: Align parseFromString errors with specs [`#454`](https://github.com/xmldom/xmldom/pull/454)
46
+
47
+ ### Chore
48
+
49
+ - stop running mutation tests using stryker [`#496`](https://github.com/xmldom/xmldom/pull/496)
50
+ - make `toErrorSnapshot` windows compatible [`#503`](https://github.com/xmldom/xmldom/pull/503)
51
+
52
+ Thank you, [@cjbarth](https://github.com/cjbarth), [@shunkica](https://github.com/shunkica), [@pmahend1](https://github.com/pmahend1), [@niklasl](https://github.com/niklasl), for your contributions
53
+
54
+
16
55
  ## [0.8.9](https://github.com/xmldom/xmldom/compare/0.8.8...0.8.9)
17
56
 
18
57
  ### Fixed
@@ -22,6 +61,52 @@ Thank you, [@qtow](https://github.com/qtow), for your contributions
22
61
  Thank you, [@cjbarth](https://github.com/cjbarth), for your contributions
23
62
 
24
63
 
64
+ ## [0.7.12](https://github.com/xmldom/xmldom/compare/0.7.11...0.7.12)
65
+
66
+ ### Fixed
67
+
68
+ - Set nodeName property in ProcessingInstruction [`#509`](https://github.com/xmldom/xmldom/pull/509) / [`#505`](https://github.com/xmldom/xmldom/issues/505)
69
+
70
+ Thank you, [@cjbarth](https://github.com/cjbarth), for your contributions
71
+
72
+
73
+ ## [0.9.0-beta.8](https://github.com/xmldom/xmldom/compare/0.9.0-beta.7...0.9.0-beta.8)
74
+
75
+ ### Fixed
76
+
77
+ - Throw DOMException when calling removeChild with invalid parameter [`#494`](https://github.com/xmldom/xmldom/pull/494) / [`#135`](https://github.com/xmldom/xmldom/issues/135)
78
+
79
+ BREAKING CHANGE: Previously it was possible (but not documented) to call `Node.removeChild` with any node in the tree,
80
+ and with certain exceptions, it would work. This is no longer the case: calling `Node.removeChild` with an argument that is not a direct child of the node that it is called from, will throw a NotFoundError DOMException, as it is described by the specs.
81
+
82
+ Thank you, [@noseworthy](https://github.com/noseworthy), [@davidmc24](https://github.com/davidmc24), for your contributions
83
+
84
+
85
+ ## [0.9.0-beta.7](https://github.com/xmldom/xmldom/compare/0.9.0-beta.6...0.9.0-beta.7)
86
+
87
+ ### Feature
88
+
89
+ - Add `compareDocumentPosition` method from level 3 spec. [`#488`](https://github.com/xmldom/xmldom/pull/488)
90
+
91
+ ### Fixed
92
+
93
+ - `getAttribute` and `getAttributeNS` should return `null` (#477) [`#46`](https://github.com/xmldom/xmldom/issues/46)
94
+ - several issues in NamedNodeMap and Element (#482) [`#46`](https://github.com/xmldom/xmldom/issues/46)
95
+ - properly parse closing where the last attribute has no value [`#485`](https://github.com/xmldom/xmldom/pull/485) / [`#486`](https://github.com/xmldom/xmldom/issues/486)
96
+ - extend list of HTML entities [`#489`](https://github.com/xmldom/xmldom/pull/489)
97
+
98
+ BREAKING CHANGE: Iteration over attributes now happens in the right order and non-existing attributes now return `null` instead of undefined. THe same is true for the `namepsaceURI` and `prefix` of Attr nodes.
99
+ All of the changes are fixing misalignment with the DOM specs, so if you expected it to work as specified,
100
+ nothing should break for you.
101
+
102
+ ### Chore
103
+
104
+ - update multiple devDependencies
105
+ - Configure jest (correctly) and wallaby [`#481`](https://github.com/xmldom/xmldom/pull/481) / [`#483`](https://github.com/xmldom/xmldom/pull/483)
106
+
107
+ Thank you, [@bulandent](https://github.com/bulandent), [@zorkow](https://github.com/zorkow), for your contributions
108
+
109
+
25
110
  ## [0.8.8](https://github.com/xmldom/xmldom/compare/0.8.7...0.8.8)
26
111
 
27
112
  ### Fixed
@@ -30,6 +115,15 @@ Thank you, [@cjbarth](https://github.com/cjbarth), for your contributions
30
115
 
31
116
  Thank you, [@zorkow](https://github.com/zorkow), for your contributions
32
117
 
118
+ ## [0.7.11](https://github.com/xmldom/xmldom/compare/0.7.10...0.7.11)
119
+
120
+ ### Fixed
121
+
122
+ - extend list of HTML entities [`#489`](https://github.com/xmldom/xmldom/pull/489)
123
+
124
+ Thank you, [@zorkow](https://github.com/zorkow), for your contributions
125
+
126
+
33
127
  ## [0.8.7](https://github.com/xmldom/xmldom/compare/0.8.6...0.8.7)
34
128
 
35
129
  ### Fixed
@@ -57,6 +151,33 @@ Thank you, [@bulandent](https://github.com/bulandent), for your contributions
57
151
  Thank you, [@edemaine](https://github.com/edemaine), [@pedro-l9](https://github.com/pedro-l9), for your contributions
58
152
 
59
153
 
154
+ ## [0.7.9](https://github.com/xmldom/xmldom/compare/0.7.8...0.7.9)
155
+
156
+ ### Fixed
157
+
158
+ - Properly check nodes before replacement [`#457`](https://github.com/xmldom/xmldom/pull/457) / [`#455`](https://github.com/xmldom/xmldom/issues/455) / [`#456`](https://github.com/xmldom/xmldom/issues/456)
159
+
160
+ Thank you, [@edemaine](https://github.com/edemaine), [@pedro-l9](https://github.com/pedro-l9), for your contributions
161
+
162
+
163
+ ## [0.9.0-beta.6](https://github.com/xmldom/xmldom/compare/0.9.0-beta.5...0.9.0-beta.6)
164
+
165
+ ### Fixed
166
+
167
+ - Properly check nodes before replacement [`#457`](https://github.com/xmldom/xmldom/pull/457) / [`#455`](https://github.com/xmldom/xmldom/issues/455) / [`#456`](https://github.com/xmldom/xmldom/issues/456)
168
+
169
+ Thank you, [@edemaine](https://github.com/edemaine), [@pedro-l9](https://github.com/pedro-l9), for your contributions
170
+
171
+
172
+ ## [0.9.0-beta.5](https://github.com/xmldom/xmldom/compare/0.9.0-beta.4...0.9.0-beta.5)
173
+
174
+ ### Fixed
175
+
176
+ - fix: Restore ES5 compatibility [`#452`](https://github.com/xmldom/xmldom/pull/452) / [`#453`](https://github.com/xmldom/xmldom/issues/453)
177
+
178
+ Thank you, [@fengxinming](https://github.com/fengxinming), for your contributions
179
+
180
+
60
181
  ## [0.8.5](https://github.com/xmldom/xmldom/compare/0.8.4...0.8.5)
61
182
 
62
183
  ### Fixed
@@ -66,6 +187,34 @@ Thank you, [@edemaine](https://github.com/edemaine), [@pedro-l9](https://github.
66
187
  Thank you, [@fengxinming](https://github.com/fengxinming), for your contributions
67
188
 
68
189
 
190
+ ## [0.7.8](https://github.com/xmldom/xmldom/compare/0.7.7...0.7.8)
191
+
192
+ ### Fixed
193
+
194
+ - fix: Restore ES5 compatibility [`#452`](https://github.com/xmldom/xmldom/pull/452) / [`#453`](https://github.com/xmldom/xmldom/issues/453)
195
+
196
+ Thank you, [@fengxinming](https://github.com/fengxinming), for your contributions
197
+
198
+
199
+ ## [0.9.0-beta.4](https://github.com/xmldom/xmldom/compare/0.9.0-beta.3...0.9.0-beta.4)
200
+
201
+ ### Fixed
202
+
203
+ - Security: Prevent inserting DOM nodes when they are not well-formed [`CVE-2022-39353`](https://github.com/xmldom/xmldom/security/advisories/GHSA-crh6-fp67-6883)
204
+ In case such a DOM would be created, the part that is not well-formed will be transformed into text nodes, in which xml specific characters like `<` and `>` are encoded accordingly.
205
+ In the upcoming version 0.9.0 those text nodes will no longer be added and an error will be thrown instead.
206
+ This change can break your code, if you relied on this behavior, e.g. multiple root elements in the past. We consider it more important to align with the specs that we want to be aligned with, considering the potential security issues that might derive from people not being aware of the difference in behavior.
207
+ Related Spec: <https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity>
208
+
209
+ ### Chore
210
+
211
+ - update multiple devDependencies
212
+ - Add eslint-plugin-node for `lib` [`#448`](https://github.com/xmldom/xmldom/pull/448) / [`#190`](https://github.com/xmldom/xmldom/issues/190)
213
+ - style: Apply prettier to all code [`#447`](https://github.com/xmldom/xmldom/pull/447) / [`#29`](https://github.com/xmldom/xmldom/issues/29) / [`#130`](https://github.com/xmldom/xmldom/issues/130)
214
+
215
+ Thank you, [@XhmikosR](https://github.com/XhmikosR), [@awwright](https://github.com/awwright), [@frumioj](https://github.com/frumioj), [@cjbarth](https://github.com/cjbarth), [@markgollnick](https://github.com/markgollnick) for your contributions
216
+
217
+
69
218
  ## [0.8.4](https://github.com/xmldom/xmldom/compare/0.8.3...0.8.4)
70
219
 
71
220
  ### Fixed
@@ -79,6 +228,43 @@ Thank you, [@fengxinming](https://github.com/fengxinming), for your contribution
79
228
  Thank you, [@frumioj](https://github.com/frumioj), [@cjbarth](https://github.com/cjbarth), [@markgollnick](https://github.com/markgollnick) for your contributions
80
229
 
81
230
 
231
+ ## [0.7.7](https://github.com/xmldom/xmldom/compare/0.7.6...0.7.7)
232
+
233
+ ### Fixed
234
+
235
+ - Security: Prevent inserting DOM nodes when they are not well-formed [`CVE-2022-39353`](https://github.com/xmldom/xmldom/security/advisories/GHSA-crh6-fp67-6883)
236
+ In case such a DOM would be created, the part that is not well-formed will be transformed into text nodes, in which xml specific characters like `<` and `>` are encoded accordingly.
237
+ In the upcoming version 0.9.0 those text nodes will no longer be added and an error will be thrown instead.
238
+ This change can break your code, if you relied on this behavior, e.g. multiple root elements in the past. We consider it more important to align with the specs that we want to be aligned with, considering the potential security issues that might derive from people not being aware of the difference in behavior.
239
+ Related Spec: <https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity>
240
+
241
+ Thank you, [@frumioj](https://github.com/frumioj), [@cjbarth](https://github.com/cjbarth), [@markgollnick](https://github.com/markgollnick) for your contributions
242
+
243
+
244
+ ## [0.9.0-beta.3](https://github.com/xmldom/xmldom/compare/0.9.0-beta.2...0.9.0-beta.3)
245
+
246
+ ### Fixed
247
+
248
+ - fix: Stop adding tags after incomplete closing tag [`#445`](https://github.com/xmldom/xmldom/pull/445) / [`#416`](https://github.com/xmldom/xmldom/pull/416)
249
+ BREAKING CHANGE: It no longer reports an error when parsing HTML containing incomplete closing tags, to align the behavior with the one in the browser.
250
+ BREAKING CHANGE: If your code relied on not well-formed XML to be parsed and include subsequent tags, this will no longer work.
251
+ - fix: Avoid bidirectional characters in source code [`#440`](https://github.com/xmldom/xmldom/pull/440)
252
+
253
+ ### Other
254
+
255
+ - ci: Add CodeQL scan [`#444`](https://github.com/xmldom/xmldom/pull/444)
256
+
257
+ Thank you, [@ACN-kck](https://github.com/ACN-kck), [@mgerlach](https://github.com/mgerlach) for your contributions
258
+
259
+
260
+ ## [0.7.6](https://github.com/xmldom/xmldom/compare/0.7.5...0.7.6)
261
+
262
+ ### Fixed
263
+ - Avoid iterating over prototype properties [`#441`](https://github.com/xmldom/xmldom/pull/441) / [`#437`](https://github.com/xmldom/xmldom/pull/437) / [`#436`](https://github.com/xmldom/xmldom/issues/436)
264
+
265
+ Thank you, [@jftanner](https://github.com/jftanner), [@Supraja9726](https://github.com/Supraja9726) for your contributions
266
+
267
+
82
268
  ## [0.8.3](https://github.com/xmldom/xmldom/compare/0.8.3...0.8.2)
83
269
 
84
270
  ### Fixed
@@ -87,6 +273,58 @@ Thank you, [@frumioj](https://github.com/frumioj), [@cjbarth](https://github.com
87
273
  Thank you, [@Supraja9726](https://github.com/Supraja9726) for your contributions
88
274
 
89
275
 
276
+ ## [0.9.0-beta.2](https://github.com/xmldom/xmldom/compare/0.9.0-beta.1...0.9.0-beta.2)
277
+
278
+ ### Fixed
279
+ - Avoid iterating over prototype properties [`#437`](https://github.com/xmldom/xmldom/pull/437) / [`#436`](https://github.com/xmldom/xmldom/issues/436)
280
+
281
+ Thank you, [@Supraja9726](https://github.com/Supraja9726) for your contributions
282
+
283
+
284
+ ## [0.9.0-beta.1](https://github.com/xmldom/xmldom/compare/0.8.2...0.9.0-beta.1)
285
+
286
+ ### Fixed
287
+
288
+ **Only use HTML rules if mimeType matches** [`#338`](https://github.com/xmldom/xmldom/pull/338), fixes [`#203`](https://github.com/xmldom/xmldom/issues/203)
289
+
290
+ In the living specs for parsing XML and HTML, that this library is trying to implement,
291
+ there is a distinction between the different types of documents being parsed:
292
+ There are quite some rules that are different for parsing, constructing and serializing XML vs HTML documents.
293
+
294
+ So far xmldom was always "detecting" whether "the HTML rules should be applied" by looking at the current namespace. So from the first time an the HTML default namespace (`http://www.w3.org/1999/xhtml`) was found, every node was treated as being part of an HTML document. This misconception is the root cause for quite some reported bugs.
295
+
296
+ BREAKING CHANGE: HTML rules are no longer applied just because of the namespace, but require the `mimeType` argument passed to `DOMParser.parseFromString(source, mimeType)` to match `'text/html'`. Doing so implies all rules for handling casing for tag and attribute names when parsing, creation of nodes and searching nodes.
297
+
298
+ BREAKING CHANGE: Correct the return type of `DOMParser.parseFromString` to `Document | undefined`. In case of parsing errors it was always possible that "the returned `Document`" has not been created. In case you are using Typescript you now need to handle those cases.
299
+
300
+ BREAKING CHANGE: The instance property `DOMParser.options` is no longer available, instead use the individual `readonly` property per option (`assign`, `domHandler`, `errorHandler`, `normalizeLineEndings`, `locator`, `xmlns`). Those also provides the default value if the option was not passed. The 'locator' option is now just a boolean (default remains `true`).
301
+
302
+ BREAKING CHANGE: The following methods no longer allow a (non spec compliant) boolean argument to toggle "HTML rules":
303
+ - `XMLSerializer.serializeToString`
304
+ - `Node.toString`
305
+ - `Document.toString`
306
+
307
+ The following interfaces have been implemented:
308
+ `DOMImplementation` now implements all methods defined in the DOM spec, but not all of the behavior is implemented (see docstring):
309
+ - `createDocument` creates an "XML Document" (prototype: `Document`, property `type` is `'xml'`)
310
+ - `createHTMLDocument` creates an "HTML Document" (type/prototype: `Document`, property `type` is `'html'`).
311
+ - when no argument is passed or the first argument is a string, the basic nodes for an HTML structure are created, as specified
312
+ - when the first argument is `false` no child nodes are created
313
+
314
+ `Document` now has two new readonly properties as specified in the DOM spec:
315
+ - `contentType` which is the mime-type that was used to create the document
316
+ - `type` which is either the string literal `'xml'` or `'html'`
317
+
318
+ `MIME_TYPE` (`/lib/conventions.js`):
319
+ - `hasDefaultHTMLNamespace` test if the provided string is one of the miem types that implies the default HTML namespace: `text/html` or `application/xhtml+xml`
320
+
321
+ Thank you [@weiwu-zhang](https://github.com/weiwu-zhang) for your contributions
322
+
323
+ ### Chore
324
+
325
+ - update multiple devDependencies
326
+
327
+
90
328
  ## [0.8.2](https://github.com/xmldom/xmldom/compare/0.8.1...0.8.2)
91
329
 
92
330
  ### Fixed
package/SECURITY.md CHANGED
@@ -6,20 +6,20 @@ The most up-to-date version of this document can be found at <https://github.com
6
6
 
7
7
  This repository contains the code for the libraries `xmldom` and `@xmldom/xmldom` on npm.
8
8
 
9
- As long as we didn't publish v1, we aim to maintain the last two minor versions with security fixes. If it is possible we provide security fixes as path versions.
10
- If you think there is a good reason to also patch an earlier version let us know in a github issue or the release discussion once the fix has been provided.
11
- The maintainers will consider it and if we agree and have/find the required resources, a patch for that version will be provided.
9
+ As long as we didn't publish v1, we aim to maintain the last two minor versions with security fixes. If it is possible we provide security fixes as patch versions.
10
+ If you think there is a good reason to also patch an earlier version, let us know in a GitHub issue or the release discussion once the fix has been provided.
11
+ The maintainers will consider it, and if we agree and have/find the required resources, a patch for that version will be provided.
12
12
 
13
13
  Please notice that [we are no longer able to publish the (unscoped) `xmldom` package](https://github.com/xmldom/xmldom/issues/271),
14
14
  and that all existing versions of `xmldom` are affected by at least one security vulnerability and should be considered deprecated.
15
15
  You can still report issues regarding `xmldom` as described below.
16
16
 
17
- If you need help with migrating from `xmldom` to `@xmldom/xmldom`, file a github issue or PR in the affected repository and mention @karfau.
17
+ If you need help with migrating from `xmldom` to `@xmldom/xmldom`, file a GitHub issue or PR in the affected repository and mention @karfau.
18
18
 
19
19
  ## Reporting vulnerabilities
20
20
 
21
21
  Please email reports about any security related issues you find to `security@xmldom.org`, which will forward it to the list of maintainers.
22
- The maintainers will try to respond within 7 calendar days. (If nobody peplies after 7 days, please us send a reminder!)
22
+ The maintainers will try to respond within 7 calendar days. (If nobody replies after 7 days, please us send a reminder!)
23
23
  As part of you communication please make sure to always hit "Reply all", so all maintainers are kept in the loop.
24
24
 
25
25
  In addition, please include the following information along with your report:
@@ -29,15 +29,15 @@ In addition, please include the following information along with your report:
29
29
  - An explanation who can exploit this vulnerability, and what they gain when doing so -- write an attack scenario. This will help us evaluate your report quickly, especially if the issue is complex.
30
30
  - Whether this vulnerability public or known to third parties. If it is, please provide details.
31
31
 
32
- If you believe that an existing (public) issue is security-related, please send an email to `security@xmldom.org`.
32
+ If you believe that an existing (public) issue is security-related, please email `security@xmldom.org`.
33
33
  The email should include the issue URL and a short description of why it should be handled according to this security policy.
34
34
 
35
35
  Once an issue is reported, the maintainers use the following disclosure process:
36
36
 
37
37
  - When a report is received, we confirm the issue, determine its severity and the affected versions.
38
38
  - If we know of specific third-party services or software based on xmldom that require mitigation before publication, those projects will be notified.
39
- - A [github security advisory](https://docs.github.com/en/code-security/security-advisories/about-github-security-advisories) is [created](https://docs.github.com/en/code-security/security-advisories/creating-a-security-advisory) (but not published) which details the problem and steps for mitigation.
40
- - If the reporter provides a github account and agrees to it, we (add that github account as a collaborator on the advisuory)[https://docs.github.com/en/code-security/security-advisories/adding-a-collaborator-to-a-security-advisory].
39
+ - A [GitHub security advisory](https://docs.github.com/en/code-security/security-advisories/about-github-security-advisories) is [created](https://docs.github.com/en/code-security/security-advisories/creating-a-security-advisory) (but not published) which details the problem and steps for mitigation.
40
+ - If the reporter provides a GitHub account and agrees to it, we [add that GitHub account as a collaborator on the advisory](https://docs.github.com/en/code-security/security-advisories/adding-a-collaborator-to-a-security-advisory).
41
41
  - The vulnerability is fixed in a [private fork](https://docs.github.com/en/code-security/security-advisories/collaborating-in-a-temporary-private-fork-to-resolve-a-security-vulnerability) and potential workarounds are identified.
42
42
  - The maintainers audit the existing code to find any potential similar problems.
43
43
  - The release for the current minor version and the [security advisory are published](https://docs.github.com/en/code-security/security-advisories/publishing-a-security-advisory).