|
|
@@ -120,9 +120,15 @@ this.RulesMatcher = this.RulesMatcher || (() => {
|
|
|
ruleInfo = elementInfo[elementRuleIndex];
|
|
|
}
|
|
|
if (ruleInfo) {
|
|
|
- if (compareSpecificity(ruleInfo.specificity, specificity) == 1 && !IGNORED_PSEUDO_CLASSES.find(pseudoClass => selectorText.includes(pseudoClass))) {
|
|
|
- ruleInfo.specificity = specificity;
|
|
|
- ruleInfo.selectorText = selectorText;
|
|
|
+ if (compareSpecificity(ruleInfo.specificity, specificity) == 1) {
|
|
|
+ let pseudoClassIndex = 0;
|
|
|
+ while (pseudoClassIndex < IGNORED_PSEUDO_CLASSES.length && !selectorText.includes(IGNORED_PSEUDO_CLASSES[pseudoClassIndex])) {
|
|
|
+ pseudoClassIndex++;
|
|
|
+ }
|
|
|
+ if (pseudoClassIndex < IGNORED_PSEUDO_CLASSES.length && selectorText.includes(IGNORED_PSEUDO_CLASSES[pseudoClassIndex])) {
|
|
|
+ ruleInfo.specificity = specificity;
|
|
|
+ ruleInfo.selectorText = selectorText;
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
ruleInfo = { cssRule, specificity, selectorText, selectorsText };
|