Match selectors inside ShadowRoot trees
This commit is contained in:
1 parent
a4a3ea49ba
commit
6fdcd19898
4 files changed
+33
-9
No files matched your search
Vendored
+1
-7
@@ -2059,13 +2059,7 @@ class Element extends Node {
|
||||
if (rest === "") return true;
|
||||
return this.matches(rest);
|
||||
}
|
||||
const parent = this.parentNode;
|
||||
if (!parent || !parent.querySelectorAll) return false;
|
||||
const matches = parent.querySelectorAll(s);
|
||||
for (let i = 0; i < matches.length; i++) {
|
||||
if (matches[i]._nid === this._nid) return true;
|
||||
}
|
||||
return false;
|
||||
return _dom("matches_selector", this._nid, String(s)) === "true";
|
||||
}
|
||||
closest(s) {
|
||||
let el = this;
|
||||
|
||||
Reference in new issue
Block a user