Skip to content

Commit

Permalink
Update matcher.js
Browse files Browse the repository at this point in the history
  • Loading branch information
asamuzaK committed Sep 24, 2023
1 parent 0cd5e18 commit 3d44ef7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/js/matcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -2049,12 +2049,12 @@ export class Matcher {
}
}
} else if (root.nodeType === DOCUMENT_FRAGMENT_NODE) {
const { children } = root;
for (const child of children) {
if (child.classList.contains(leafName)) {
arr.push(child);
const iterator = [...root.children].values();
for (const node of iterator) {
if (node.classList.contains(leafName)) {
arr.push(node);
}
const a = [...child.getElementsByClassName(leafName)];
const a = [...node.getElementsByClassName(leafName)];
arr.push(...a);
}
} else {
Expand Down Expand Up @@ -2110,12 +2110,12 @@ export class Matcher {
const a = xpath.select(`//*[local-name()='${tagName}']`, root);
arr.push(...a);
} else if (root.nodeType === DOCUMENT_FRAGMENT_NODE) {
const { children } = root;
for (const child of children) {
if (child.localName === tagName) {
arr.push(child);
const iterator = [...root.children].values();
for (const node of iterator) {
if (node.localName === tagName) {
arr.push(node);
}
const a = [...child.getElementsByTagName(leafName)];
const a = [...node.getElementsByTagName(leafName)];
arr.push(...a);
}
} else if (root.nodeType === ELEMENT_NODE) {
Expand Down

0 comments on commit 3d44ef7

Please sign in to comment.