|
|
@@ -136,8 +136,7 @@ this.matchedRules = this.matchedRules || (() => {
|
|
|
|
|
|
function getMatchedElementsSelector(doc, selectorInfo, styles, matchedElementsCache) {
|
|
|
let selectorText;
|
|
|
- const selectorData = cssTree.parse(cssTree.generate(selectorInfo.selector.data), { context: "selector" });
|
|
|
- const filteredSelectorText = getFilteredSelector({ data: selectorData });
|
|
|
+ const filteredSelectorText = getFilteredSelector(selectorInfo.selector, selectorInfo.selectorText);
|
|
|
if (filteredSelectorText != selectorInfo.selectorText) {
|
|
|
selectorText = filteredSelectorText;
|
|
|
} else {
|
|
|
@@ -172,7 +171,7 @@ this.matchedRules = this.matchedRules || (() => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function getFilteredSelector(selector) {
|
|
|
+ function getFilteredSelector(selector, selectorText) {
|
|
|
const removedSelectors = [];
|
|
|
selector = { data: cssTree.parse(cssTree.generate(selector.data), { context: "selector" }) };
|
|
|
filterPseudoClasses(selector);
|
|
|
@@ -184,8 +183,8 @@ this.matchedRules = this.matchedRules || (() => {
|
|
|
parentSelector.data.children.remove(selector);
|
|
|
}
|
|
|
});
|
|
|
+ selectorText = cssTree.generate(selector.data).trim();
|
|
|
}
|
|
|
- const selectorText = cssTree.generate(selector.data).trim();
|
|
|
return selectorText;
|
|
|
|
|
|
function filterPseudoClasses(selector, parentSelector) {
|