|
|
@@ -86,12 +86,12 @@ this.RulesMatcher = this.RulesMatcher || (() => {
|
|
|
const selectorText = cssWhat.stringify([selector]);
|
|
|
let matchedElements = matchedElementsCache.get(selectorText);
|
|
|
if (!matchedElements) {
|
|
|
- if (unmatchedSelectorsCache.find(selector => selectorText.startsWith(selector + " "))) {
|
|
|
+ if (unmatchedSelectorsCache.find(selector => selectorText.startsWith(selector))) {
|
|
|
matchedElements = [];
|
|
|
} else {
|
|
|
matchedElements = doc.querySelectorAll(selectorText);
|
|
|
- if (!matchedElements.length && !unmatchedSelectorsCache.includes(selectorText)) {
|
|
|
- unmatchedSelectorsCache.push(selectorText);
|
|
|
+ if (!matchedElements.length) {
|
|
|
+ unmatchedSelectorsCache.push(selectorText + " ");
|
|
|
}
|
|
|
}
|
|
|
matchedElementsCache.set(selectorText, matchedElements);
|