Change deprecated Attr.nodeValue to Attr.value
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2819 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -156,13 +156,13 @@ svgedit.sanitize.sanitizeSvg = function(node) {
|
|||||||
// Check that an attribute with the correct localName in the correct namespace is on
|
// Check that an attribute with the correct localName in the correct namespace is on
|
||||||
// our whitelist or is a namespace declaration for one of our allowed namespaces
|
// our whitelist or is a namespace declaration for one of our allowed namespaces
|
||||||
if (!(allowedAttrsNS.hasOwnProperty(attrLocalName) && attrNsURI == allowedAttrsNS[attrLocalName] && attrNsURI != NS.XMLNS) &&
|
if (!(allowedAttrsNS.hasOwnProperty(attrLocalName) && attrNsURI == allowedAttrsNS[attrLocalName] && attrNsURI != NS.XMLNS) &&
|
||||||
!(attrNsURI == NS.XMLNS && REVERSE_NS[attr.nodeValue]) )
|
!(attrNsURI == NS.XMLNS && REVERSE_NS[attr.value]) )
|
||||||
{
|
{
|
||||||
// TODO(codedread): Programmatically add the se: attributes to the NS-aware whitelist.
|
// TODO(codedread): Programmatically add the se: attributes to the NS-aware whitelist.
|
||||||
// Bypassing the whitelist to allow se: prefixes.
|
// Bypassing the whitelist to allow se: prefixes.
|
||||||
// Is there a more appropriate way to do this?
|
// Is there a more appropriate way to do this?
|
||||||
if (attrName.indexOf('se:') === 0) {
|
if (attrName.indexOf('se:') === 0) {
|
||||||
seAttrs.push([attrName, attr.nodeValue]);
|
seAttrs.push([attrName, attr.value]);
|
||||||
}
|
}
|
||||||
node.removeAttributeNS(attrNsURI, attrLocalName);
|
node.removeAttributeNS(attrNsURI, attrLocalName);
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ svgedit.sanitize.sanitizeSvg = function(node) {
|
|||||||
case 'transform':
|
case 'transform':
|
||||||
case 'gradientTransform':
|
case 'gradientTransform':
|
||||||
case 'patternTransform':
|
case 'patternTransform':
|
||||||
var val = attr.nodeValue.replace(/(\d)-/g, '$1 -');
|
var val = attr.value.replace(/(\d)-/g, '$1 -');
|
||||||
node.setAttribute(attrName, val);
|
node.setAttribute(attrName, val);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -181,7 +181,7 @@ svgedit.sanitize.sanitizeSvg = function(node) {
|
|||||||
|
|
||||||
// For the style attribute, rewrite it in terms of XML presentational attributes
|
// For the style attribute, rewrite it in terms of XML presentational attributes
|
||||||
if (attrName == 'style') {
|
if (attrName == 'style') {
|
||||||
var props = attr.nodeValue.split(';'),
|
var props = attr.value.split(';'),
|
||||||
p = props.length;
|
p = props.length;
|
||||||
while (p--) {
|
while (p--) {
|
||||||
var nv = props[p].split(':');
|
var nv = props[p].split(':');
|
||||||
|
|||||||
Reference in New Issue
Block a user