Skip to content

Commit

Permalink
plugins/removeNonInheritableGroupAttrs: more attrs groups to exclude (f…
Browse files Browse the repository at this point in the history
…ix #118)
  • Loading branch information
deepsweet committed May 30, 2013
1 parent 0b5f72e commit 8184320
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions plugins/removeNonInheritableGroupAttrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

/**
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/removeNonInheritableGroupAttrs.01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8184320

Please sign in to comment.