From f78cd7598413832bf464408bbc8d4dd82316b213 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Wed, 28 Apr 2010 21:43:33 +0000 Subject: [PATCH] More bogus attribute/namespace fixes. git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1553 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svgcanvas.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 31a253a4..d4861d0e 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1617,7 +1617,7 @@ function BatchCommand(text) { var el = this; $.each(this.attributes, function(i, attr) { var uri = attr.namespaceURI; - if(uri && !nsuris[uri] && nsMap[uri] !== 'xmlns') { + if(uri && !nsuris[uri] && nsMap[uri] !== 'xmlns' && nsMap[uri] !== 'xml' ) { nsuris[uri] = true; out.push(" xmlns:" + nsMap[uri] + '="' + uri +'"'); } @@ -1632,9 +1632,6 @@ function BatchCommand(text) { // Namespaces have already been dealt with, so skip if(attr.nodeName.indexOf('xmlns:') === 0) continue; - //remove bogus attributes added by Gecko - if (attr.localName == '-moz-math-font-style') continue; - // only serialize attributes we don't use internally if (attrVal != "" && $.inArray(attr.localName, ['width','height','xmlns','x','y','viewBox','id','overflow']) == -1) @@ -1651,7 +1648,8 @@ function BatchCommand(text) { for (var i=attrs.length-1; i>=0; i--) { attr = attrs.item(i); var attrVal = toXml(attr.nodeValue); - if (attr.localName == '-moz-math-font-style') continue; + //remove bogus attributes added by Gecko + if ($.inArray(attr.localName, ['-moz-math-font-style', '_moz-math-font-style']) !== -1) continue; if (attrVal != "") { if(attrVal.indexOf('pointer-events') == 0) continue; if(attr.localName == "class" && attrVal.indexOf('se_') == 0) continue;