1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-31 07:44:22 +03:00

Fix removeNonInheritableGroupAttrs not working as intended

This commit is contained in:
GreLI
2018-09-15 22:48:09 +03:00
parent f3bcbcc6a6
commit 36db31adcf
3 changed files with 18 additions and 4 deletions

View File

@ -8,7 +8,7 @@ exports.description = 'removes non-inheritable groups presentational attribut
var inheritableAttrs = require('./_collections').inheritableAttrs,
attrsGroups = require('./_collections').attrsGroups,
excludedAttrs = ['display', 'opacity'];
excludedAttrs = ['display', 'clip', 'clip-path', 'mask', 'opacity', 'overflow', 'visibility'];
/**
* Remove non-inheritable group's "presentation" attributes.
@ -25,9 +25,9 @@ exports.fn = function(item) {
item.eachAttr(function(attr) {
if (
~attrsGroups.presentation.indexOf(attr.name) &&
~attrsGroups.graphicalEvent.indexOf(attr.name) &&
~attrsGroups.core.indexOf(attr.name) &&
~attrsGroups.conditionalProcessing.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)
) {