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:
@@ -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">
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user