fix text node reattachment when parent changes but node value does not

This commit is contained in:
Leo Horie 2014-04-13 11:10:25 -04:00
parent 215b56ae7c
commit f768b7bb63
60 changed files with 6859 additions and 8 deletions

View file

@ -97,14 +97,12 @@ new function(window) {
}
else {
node = window.document.createTextNode(data)
console.log(555, node, index, parent.childNodes)
parent.insertBefore(node, index !== undefined ? parent.childNodes[index] : null)
console.log(666,parent.childNodes)
}
cached = "string number boolean".indexOf(typeof data) > -1 ? new data.constructor(data) : data
cached.nodes = [node]
}
else if (cached.valueOf() !== data.valueOf()) {
else if (cached.valueOf() !== data.valueOf() || shouldReattach === true) {
if (data.$trusted) {
var current = cached.nodes[0], nodes = [current]
if (current) {