Skip to content

Commit

Permalink
Merge pull request #71 from canjs/fix-svg-setAttributeNS-ie11
Browse files Browse the repository at this point in the history
fix svg namespaceURI for IE11
  • Loading branch information
cherifGsoul authored Nov 26, 2018
2 parents dc347ef + dc82241 commit 4488f74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion can-view-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ var cloneNode = clonesWork ?
for (var i = 0; i < attributes.length; i++) {
var attribute = attributes[i];
if (attribute && attribute.specified) {
domMutate.setAttribute.call(copy, attribute.nodeName || attribute.name, attribute.nodeValue || attribute.value);
// If the attribute has a namespace set the namespace
// otherwise it will be set to null
if (attribute.namespaceURI) {
copy.setAttributeNS(attribute.namespaceURI, attribute.nodeName || attribute.name, attribute.nodeValue || attribute.value);
} else {
copy.setAttribute(attribute.nodeName || attribute.name, attribute.nodeValue || attribute.value);
}
}
}
}
Expand Down

0 comments on commit 4488f74

Please sign in to comment.