Fix problem with appendChild when appending a fragment (the fragment needs to be cleared)
This commit is contained in:
parent
31f654fd0b
commit
61abf6c9a6
File diff suppressed because one or more lines are too long
|
@ -77,7 +77,8 @@
|
||||||
this.childNodes[i] = node; node.nextSibling = old.nextSibling;
|
this.childNodes[i] = node; node.nextSibling = old.nextSibling;
|
||||||
old.nextSibling = old.parent = null;
|
old.nextSibling = old.parent = null;
|
||||||
return old;
|
return old;
|
||||||
}
|
},
|
||||||
|
toString: function () {return "{"+this.childNodes.join("")+"}"}
|
||||||
});
|
});
|
||||||
|
|
||||||
var INITASCIIMATH = function () {
|
var INITASCIIMATH = function () {
|
||||||
|
@ -101,7 +102,12 @@
|
||||||
},
|
},
|
||||||
appendChild: function (node) {
|
appendChild: function (node) {
|
||||||
if (node.parent) {node.parent.removeChild(node)}
|
if (node.parent) {node.parent.removeChild(node)}
|
||||||
var nodes = arguments; if (node.isa(DOCFRAG)) {nodes = node.childNodes}
|
var nodes = arguments;
|
||||||
|
if (node.isa(DOCFRAG)) {
|
||||||
|
nodes = node.childNodes;
|
||||||
|
node.data = node.childNodes = [];
|
||||||
|
node.firstChild = node.lastChild = null;
|
||||||
|
}
|
||||||
for (var i = 0, m = nodes.length; i < m; i++) {
|
for (var i = 0, m = nodes.length; i < m; i++) {
|
||||||
node = nodes[i];
|
node = nodes[i];
|
||||||
if (this.lastChild) {this.lastChild.nextSibling = node}
|
if (this.lastChild) {this.lastChild.nextSibling = node}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user