소스 검색

ensure values are not empty when computing used properties

Gildas 7 년 전
부모
커밋
809479713b
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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 });
 					}
 				});