Skip to content

Commit

Permalink
Update finder.js
Browse files Browse the repository at this point in the history
  • Loading branch information
asamuzaK committed Feb 2, 2024
1 parent ea124f3 commit 9b9b824
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/js/finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1702,14 +1702,18 @@ export class Finder {
let matched = new Set();
if (node.nodeType === ELEMENT_NODE) {
switch (astType) {
case SELECTOR_CLASS: {
if (node.classList.contains(astName)) {
case SELECTOR_PSEUDO_ELEMENT: {
matchPseudoElementSelector(astName, opt);
break;
}
case SELECTOR_ID: {
if (node.id === astName) {
matched.add(node);
}
break;
}
case SELECTOR_ID: {
if (astName === node.id) {
case SELECTOR_CLASS: {
if (node.classList.contains(astName)) {
matched.add(node);
}
break;
Expand All @@ -1721,10 +1725,6 @@ export class Finder {
}
break;
}
case SELECTOR_PSEUDO_ELEMENT: {
matchPseudoElementSelector(astName, opt);
break;
}
default: {
const res = matchSelector(ast, node, opt);
if (res) {
Expand Down

0 comments on commit 9b9b824

Please sign in to comment.