Potential fix for issue 889, importing problems by adding style element to whitelist (patch by asyazwan)

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2057 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2012-02-26 18:08:34 +00:00
parent e9cb4c2ce1
commit 0f85c54128
2 changed files with 8 additions and 1 deletions

View File

@ -50,6 +50,7 @@ var svgWhiteList_ = {
"circle": ["class", "clip-path", "clip-rule", "cx", "cy", "fill", "fill-opacity", "fill-rule", "filter", "id", "mask", "opacity", "r", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform"], "circle": ["class", "clip-path", "clip-rule", "cx", "cy", "fill", "fill-opacity", "fill-rule", "filter", "id", "mask", "opacity", "r", "requiredFeatures", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform"],
"clipPath": ["class", "clipPathUnits", "id"], "clipPath": ["class", "clipPathUnits", "id"],
"defs": [], "defs": [],
"style" : ["type"],
"desc": [], "desc": [],
"ellipse": ["class", "clip-path", "clip-rule", "cx", "cy", "fill", "fill-opacity", "fill-rule", "filter", "id", "mask", "opacity", "requiredFeatures", "rx", "ry", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform"], "ellipse": ["class", "clip-path", "clip-rule", "cx", "cy", "fill", "fill-opacity", "fill-rule", "filter", "id", "mask", "opacity", "requiredFeatures", "rx", "ry", "stroke", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke-width", "style", "systemLanguage", "transform"],
"feGaussianBlur": ["class", "color-interpolation-filters", "id", "requiredFeatures", "stdDeviation"], "feGaussianBlur": ["class", "color-interpolation-filters", "id", "requiredFeatures", "stdDeviation"],

View File

@ -5734,7 +5734,13 @@ this.setSvgString = function(xmlString) {
batchCmd.addSubCommand(new RemoveElementCommand(oldzoom, nextSibling, svgroot)); batchCmd.addSubCommand(new RemoveElementCommand(oldzoom, nextSibling, svgroot));
// set new svg document // set new svg document
svgcontent = svgroot.appendChild(svgdoc.importNode(newDoc.documentElement, true)); var _tmpDoc = newDoc.documentElement;
//TODO: remove isChrome() blocks when importNode is fixed
//Issue: https://code.google.com/p/chromium/issues/detail?id=57871
if(svgedit.browser.isChrome()) {
_tmpDoc = $(newDoc.documentElement).clone(true)[0];
}
svgcontent = svgroot.appendChild(_tmpDoc);
var content = $(svgcontent); var content = $(svgcontent);