Fix Issue 486: Remove uses without href to prevent Safari crash. Turns all unit tests green

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1408 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2010-02-18 01:34:29 +00:00
parent 60c2d8c007
commit 8e0bf800bf
3 changed files with 11 additions and 14 deletions

View File

@@ -45,17 +45,6 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<title>SVG-edit</title>
</head>
<body>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"> </script>
<div id="placeholder"></div>
<script>
CFInstall.check({
node: "placeholder",
destination: "http://www.waikiki.com"
});
</script>
<div id="svg_editor">
<div id="workarea">

View File

@@ -1385,6 +1385,11 @@ function BatchCommand(text) {
}
}
// Safari crashes on a <use> without a xlink:href, so we just remove the node here
if (node.nodeName == "use" && !node.getAttributeNS(xlinkns,"href")) {
parent.removeChild(node);
return;
}
// if the element has attributes pointing to a non-local reference,
// need to remove the attribute
$.each(["clip-path", "fill", "marker-end", "marker-mid", "marker-start", "mask", "stroke"],function(i,attr) {