@xmldom/xmldom 0.7.11 → 0.7.13
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.7.13](https://github.com/xmldom/xmldom/compare/0.7.12...0.7.13)
|
|
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.7.12](https://github.com/xmldom/xmldom/compare/0.7.11...0.7.12)
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- fix: 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.7.11](https://github.com/xmldom/xmldom/compare/0.7.10...0.7.11)
|
|
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);
|
|
@@ -1136,8 +1142,8 @@ Document.prototype = {
|
|
|
1136
1142
|
createProcessingInstruction : function(target,data){
|
|
1137
1143
|
var node = new ProcessingInstruction();
|
|
1138
1144
|
node.ownerDocument = this;
|
|
1139
|
-
node.tagName = node.target = target;
|
|
1140
|
-
node.nodeValue= node.data = data;
|
|
1145
|
+
node.tagName = node.nodeName = node.target = target;
|
|
1146
|
+
node.nodeValue = node.data = data;
|
|
1141
1147
|
return node;
|
|
1142
1148
|
},
|
|
1143
1149
|
createAttribute : function(name){
|