Bladeren bron

fixed rules minification

Gildas 7 jaren geleden
bovenliggende
commit
603bff5430
1 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 4 4
      lib/single-file/modules/css-matched-rules.js

+ 4 - 4
lib/single-file/modules/css-matched-rules.js

@@ -264,8 +264,9 @@ this.matchedRules = this.matchedRules || (() => {
 		mediaInfo.medias.forEach(childMediaInfo => computeCascade(childMediaInfo, [mediaInfo, ...parentMediaInfo], mediaAllInfo, workStylesheet));
 	}
 
-	function getDeclarationsInfo(elementInfo, workStylesheet/*, element */) {
+	function getDeclarationsInfo(elementInfo, workStylesheet/*, element*/) {
 		const declarationsInfo = new Map();
+		const processedProperties = new Set();
 		elementInfo.forEach(selectorInfo => {
 			let declarations;
 			if (selectorInfo.styleInfo) {
@@ -273,13 +274,12 @@ this.matchedRules = this.matchedRules || (() => {
 			} else {
 				declarations = selectorInfo.ruleInfo.ruleData.block.children;
 			}
-			processDeclarations(declarationsInfo, declarations, selectorInfo, workStylesheet);
+			processDeclarations(declarationsInfo, declarations, selectorInfo, processedProperties, workStylesheet);
 		});
 		return declarationsInfo;
 	}
 
-	function processDeclarations(declarationsInfo, declarations, selectorInfo, workStylesheet) {
-		const processedProperties = new Set();
+	function processDeclarations(declarationsInfo, declarations, selectorInfo, processedProperties, workStylesheet) {
 		for (let declaration = declarations.tail; declaration; declaration = declaration.prev) {
 			const declarationData = declaration.data;
 			const declarationText = cssTree.generate(declarationData);