|
|
@@ -24,6 +24,7 @@ this.RulesMatcher = this.RulesMatcher || (() => {
|
|
|
|
|
|
const MEDIA_ALL = "all";
|
|
|
const PRIORITY_IMPORTANT = "important";
|
|
|
+ const IGNORED_PSEUDO_CLASSES = [":focus", ":focus-within", ":hover", ":link", ":visited", ":active"]
|
|
|
|
|
|
class RulesMatcher {
|
|
|
constructor(doc) {
|
|
|
@@ -113,7 +114,7 @@ this.RulesMatcher = this.RulesMatcher || (() => {
|
|
|
specificity.sheetIndex = sheetIndex;
|
|
|
let ruleInfo = elementInfo.find(ruleInfo => ruleInfo.cssRule == cssRule);
|
|
|
if (ruleInfo) {
|
|
|
- if (compareSpecificity(ruleInfo.specificity, specificity) == 1) {
|
|
|
+ if (!IGNORED_PSEUDO_CLASSES.find(pseudoClass => selectorText.find(pseudoClass)) && compareSpecificity(ruleInfo.specificity, specificity) == 1) {
|
|
|
ruleInfo.specificity = specificity;
|
|
|
ruleInfo.selectorText = selectorText;
|
|
|
}
|