Description
We have a helper function named includesAttrSelector
. We use this to check if an attribute has been referenced in the stylesheet. If so, the plugin may have different behavior. Usually, by not removing that attribute because it may break styles otherwise.
However, our logic takes a very safe approach, of never deleting attributes if it's been referenced in CSS, even if the operator/check wouldn't match.
For example, suppose an element in an SVG had preserveAspectRatio="xMidYMid meet"
, with a CSS selector of [preserveAspectRatio^="y"]
.
This would not match, yet to be on the safe side, we will not remove the attribute. We do not actually check the operator and value, but only the key. Let's improve the logic to actually perform these checks so that we do remove the attribute when it's truly unnecessary.
References: