Fix a bug in cloning MathML nodes in Firefox

Gecko-based broswers append some weird-shit
attributes. Filter them
This commit is contained in:
Jacques Distler 2010-02-16 13:55:36 -06:00
parent 5094a7339b
commit 63f1d34d74

View file

@ -7595,6 +7595,7 @@ function BatchCommand(text) {
// manually create a copy of the element // manually create a copy of the element
var new_el = document.createElementNS(el.namespaceURI, el.nodeName); var new_el = document.createElementNS(el.namespaceURI, el.nodeName);
$.each(el.attributes, function(i, attr) { $.each(el.attributes, function(i, attr) {
if (attr.localName != '-moz-math-font-style')
new_el.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.nodeValue); new_el.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.nodeValue);
}); });
// set the copied element's new id // set the copied element's new id
@ -7617,7 +7618,7 @@ function BatchCommand(text) {
new_el.appendChild(copyElem(child)); new_el.appendChild(copyElem(child));
break; break;
case 3: // text node case 3: // text node
new_el.textContent = child.nodeValue; new_el.appendChild(child.cloneNode(false));
break; break;
default: default:
break; break;