1 | 'use strict';
|
2 |
|
3 | exports.type = 'perItem';
|
4 |
|
5 | exports.active = true;
|
6 |
|
7 | exports.description = 'removes non-inheritable group’s presentational attributes';
|
8 |
|
9 | var inheritableAttrs = require('./_collections').inheritableAttrs,
|
10 | attrsGroups = require('./_collections').attrsGroups,
|
11 | applyGroups = require('./_collections').presentationNonInheritableGroupAttrs;
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | exports.fn = function(item) {
|
22 |
|
23 | if (item.isElem('g')) {
|
24 |
|
25 | item.eachAttr(function(attr) {
|
26 | if (
|
27 | ~attrsGroups.presentation.indexOf(attr.name) &&
|
28 | !~inheritableAttrs.indexOf(attr.name) &&
|
29 | !~applyGroups.indexOf(attr.name)
|
30 | ) {
|
31 | item.removeAttr(attr.name);
|
32 | }
|
33 | });
|
34 |
|
35 | }
|
36 |
|
37 | };
|