Przeglądaj źródła

better test to avoid changing rules of universal selectors

Gildas 7 lat temu
rodzic
commit
11fc3739d1
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      lib/single-file/html-images-minifier.js

+ 1 - 1
lib/single-file/html-images-minifier.js

@@ -76,7 +76,7 @@ this.imagesMinifier = this.imagesMinifier || (() => {
 				elementInfo.forEach(selectorInfo => {
 					if (selectorInfo.selector) {
 						const firstSelector = selectorInfo.selector[0];
-						if (selectorInfo.selector.length > 1 || firstSelector.type != "universal") {
+						if (selectorInfo.selector.length > 1 || firstSelector.type == "tag" || firstSelector.type == "attribute") {
 							const selectors = matchedImageSelectors.get(selectorInfo.ruleInfo.cssRule.selectorText) || JSON.parse(JSON.stringify(selectorInfo.ruleInfo.selectors));
 							const selectorIndex = selectorInfo.ruleInfo.selectors.indexOf(selectorInfo.selector);
 							if (selectorIndex != -1 && !selectors[selectorIndex].transformed) {