mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Correctly handle trailing slashes in XML attribute namespaces.
See #984
This commit is contained in:
parent
7dd110f5b2
commit
af1c481523
1 changed files with 4 additions and 4 deletions
|
@ -24,9 +24,10 @@ var SvgElement = new function() {
|
|||
attributeNamespace = {
|
||||
href: xlink,
|
||||
xlink: xmlns,
|
||||
xmlns: xmlns,
|
||||
// Only the xmlns attribute needs the trailing slash. See #984
|
||||
xmlns: xmlns + '/',
|
||||
// IE needs the xmlns namespace when setting 'xmlns:xlink'. See #984
|
||||
'xmlns:xlink': xmlns
|
||||
'xmlns:xlink': xmlns + '/'
|
||||
};
|
||||
|
||||
function create(tag, attributes, formatter) {
|
||||
|
@ -48,8 +49,7 @@ var SvgElement = new function() {
|
|||
if (typeof value === 'number' && formatter)
|
||||
value = formatter.number(value);
|
||||
if (namespace) {
|
||||
// IE needs trailing slashes, but only when setting. See #984
|
||||
node.setAttributeNS(namespace + '/', name, value);
|
||||
node.setAttributeNS(namespace, name, value);
|
||||
} else {
|
||||
node.setAttribute(name, value);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue