@xmldom/xmldom 0.8.8 → 0.8.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 +18 -0
- package/lib/dom.js +12 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ 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.8.10](https://github.com/xmldom/xmldom/compare/0.8.9...0.8.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
|
+
Thank you, [@qtow](https://github.com/qtow), for your contributions
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [0.8.9](https://github.com/xmldom/xmldom/compare/0.8.8...0.8.9)
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Set nodeName property in ProcessingInstruction [`#509`](https://github.com/xmldom/xmldom/pull/509) / [`#505`](https://github.com/xmldom/xmldom/issues/505)
|
|
21
|
+
|
|
22
|
+
Thank you, [@cjbarth](https://github.com/cjbarth), for your contributions
|
|
23
|
+
|
|
24
|
+
|
|
7
25
|
## [0.8.8](https://github.com/xmldom/xmldom/compare/0.8.7...0.8.8)
|
|
8
26
|
|
|
9
27
|
### Fixed
|
package/lib/dom.js
CHANGED
|
@@ -169,7 +169,7 @@ NodeList.prototype = {
|
|
|
169
169
|
* The node at the indexth position in the NodeList, or null if that is not a valid index.
|
|
170
170
|
*/
|
|
171
171
|
item: function(index) {
|
|
172
|
-
return this[index]
|
|
172
|
+
return index >= 0 && index < this.length ? this[index] : null;
|
|
173
173
|
},
|
|
174
174
|
toString:function(isHTML,nodeFilter){
|
|
175
175
|
for(var buf = [], i = 0;i<this.length;i++){
|
|
@@ -202,17 +202,23 @@ function LiveNodeList(node,refresh){
|
|
|
202
202
|
}
|
|
203
203
|
function _updateLiveList(list){
|
|
204
204
|
var inc = list._node._inc || list._node.ownerDocument._inc;
|
|
205
|
-
if(list._inc
|
|
205
|
+
if (list._inc !== inc) {
|
|
206
206
|
var ls = list._refresh(list._node);
|
|
207
|
-
//console.log(ls.length)
|
|
208
207
|
__set__(list,'length',ls.length);
|
|
208
|
+
if (!list.$$length || ls.length < list.$$length) {
|
|
209
|
+
for (var i = ls.length; i in list; i++) {
|
|
210
|
+
if (Object.prototype.hasOwnProperty.call(list, i)) {
|
|
211
|
+
delete list[i];
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
209
215
|
copy(ls,list);
|
|
210
216
|
list._inc = inc;
|
|
211
217
|
}
|
|
212
218
|
}
|
|
213
219
|
LiveNodeList.prototype.item = function(i){
|
|
214
220
|
_updateLiveList(this);
|
|
215
|
-
return this[i];
|
|
221
|
+
return this[i] || null;
|
|
216
222
|
}
|
|
217
223
|
|
|
218
224
|
_extends(LiveNodeList,NodeList);
|
|
@@ -1161,8 +1167,8 @@ Document.prototype = {
|
|
|
1161
1167
|
createProcessingInstruction : function(target,data){
|
|
1162
1168
|
var node = new ProcessingInstruction();
|
|
1163
1169
|
node.ownerDocument = this;
|
|
1164
|
-
node.tagName = node.target = target;
|
|
1165
|
-
node.nodeValue= node.data = data;
|
|
1170
|
+
node.tagName = node.nodeName = node.target = target;
|
|
1171
|
+
node.nodeValue = node.data = data;
|
|
1166
1172
|
return node;
|
|
1167
1173
|
},
|
|
1168
1174
|
createAttribute : function(name){
|