Jelajahi Sumber

don't remove declarations for the same proerty and containing a vendor prefix

Gildas 7 tahun lalu
induk
melakukan
b4db0a1eec
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      lib/single-file/css-matched-rules.js

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

@@ -282,7 +282,8 @@ this.matchedRules = this.matchedRules || (() => {
 		const processedProperties = new Set();
 		for (let declaration = declarations.tail; declaration; declaration = declaration.prev) {
 			const declarationData = declaration.data;
-			if (declarationData.type == "Declaration" && !processedProperties.has(declarationData.property) && !invalidDeclaration(cssTree.generate(declarationData), stylesheet)) {
+			const declarationText = cssTree.generate(declarationData);
+			if (declarationData.type == "Declaration" && (declarationText.match(REGEXP_VENDOR_IDENTIFIER) || !processedProperties.has(declarationData.property)) && !invalidDeclaration(declarationText, stylesheet)) {
 				const styleValue = cssTree.generate(declarationData.value);
 				const elementStyleInfo = declarationsInfo.get(declarationData);
 				if (styleValue.trim() && (!elementStyleInfo || (declarationData.important && !elementStyleInfo.important))) {