Procházet zdrojové kódy

ensure values are not empty when computing used properties

Gildas před 7 roky
rodič
revize
809479713b
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      lib/single-file/css-matched-rules.js

+ 2 - 2
lib/single-file/css-matched-rules.js

@@ -246,9 +246,9 @@ this.matchedRules = this.matchedRules || (() => {
 				});
 			} else {
 				selectorInfo.ruleInfo.cssRule.block.children.forEach(declaration => {
-					const styleValue = cssTree.generate(declaration);
+					const styleValue = cssTree.generate(declaration.value);
 					const elementStyleInfo = elementStylesInfo.get(declaration.property);
-					if (!elementStyleInfo || (declaration.important && !elementStyleInfo.important)) {
+					if (styleValue.trim() && (!elementStyleInfo || (declaration.important && !elementStyleInfo.important))) {
 						elementStylesInfo.set(declaration.property, { selectorInfo, styleValue, important: declaration.important });
 					}
 				});