from.data = to.data;
return;
}
-
+ if (!from.parentNode) {
+ // not sure why this is happening?
+ return;
+ }
// assume 'to' doesnt have '1/3 nodetypes!
+ // not sure why, by from, parent node might not exist?
if (from.nodeType !=1 || from.tagName != to.tagName) {
Roo.log(["ReplaceChild" , from, to ]);
+
from.parentNode.replaceChild(to, from);
return;
}
if (ar[i].name == 'id') { // always keep ids?
continue;
}
- if (ar[i].name == 'style') {
- throw "style removed?";
- }
+ //if (ar[i].name == 'style') {
+ // throw "style removed?";
+ //}
Roo.log("removeAttribute" + ar[i].name);
from.removeAttribute(ar[i].name);
}
ar = to.attributes;
for(var i = 0; i< ar.length;i++) {
if (from.getAttribute(ar[i].name) == to.getAttribute(ar[i].name)) {
+ Roo.log("skipAttribute " + ar[i].name + '=' + to.getAttribute(ar[i].name));
continue;
}
- Roo.log("updateAttribute " + from.getAttribute(ar[i].name) + '=>' + to.getAttribute(ar[i].name));
+ Roo.log("updateAttribute " + ar[i].name + '=>' + to.getAttribute(ar[i].name));
from.setAttribute(ar[i].name, to.getAttribute(ar[i].name));
}
// children