From a47ed633615c7533ad1f61fdd0d664da3b476c64 Mon Sep 17 00:00:00 2001 From: deepsweet Date: Thu, 30 May 2013 12:08:05 +0300 Subject: [PATCH] plugins/removeNonInheritableGroupAttrs: more attrs groups to exclude (fix #118 fix #116) --- plugins/removeNonInheritableGroupAttrs.js | 11 +++++++---- test/plugins/removeNonInheritableGroupAttrs.01.svg | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/removeNonInheritableGroupAttrs.js b/plugins/removeNonInheritableGroupAttrs.js index b4751897..af7f0778 100644 --- a/plugins/removeNonInheritableGroupAttrs.js +++ b/plugins/removeNonInheritableGroupAttrs.js @@ -5,7 +5,7 @@ exports.type = 'perItem'; exports.active = true; var inheritableAttrs = require('./_collections').inheritableAttrs, - presentationAttrs = require('./_collections').attrsGroups.presentation, + attrsGroups = require('./_collections').attrsGroups, excludedAttrs = ['display', 'opacity']; /** @@ -22,9 +22,12 @@ exports.fn = function(item) { item.eachAttr(function(attr) { if ( - presentationAttrs.indexOf(attr.name) !== -1 && - excludedAttrs.indexOf(attr.name) === -1 && - inheritableAttrs.indexOf(attr.name) === -1 + ~attrsGroups.presentation.indexOf(attr.name) && + ~attrsGroups.graphicalEvent.indexOf(attr.name) && + ~attrsGroups.core.indexOf(attr.name) && + ~attrsGroups.conditionalProcessing.indexOf(attr.name) && + !~excludedAttrs.indexOf(attr.name) && + !~inheritableAttrs.indexOf(attr.name) ) { item.removeAttr(attr.name); } diff --git a/test/plugins/removeNonInheritableGroupAttrs.01.svg b/test/plugins/removeNonInheritableGroupAttrs.01.svg index d8e87663..86269d6f 100644 --- a/test/plugins/removeNonInheritableGroupAttrs.01.svg +++ b/test/plugins/removeNonInheritableGroupAttrs.01.svg @@ -7,7 +7,7 @@ @@@ - +