Skip to content

Commit df752c2

Browse files
author
blik
committed
limit fragment/ascend by Element.matches
1 parent 4fd5185 commit df752c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Blik_2023_fragment.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,12 @@
357357
return [this];
358358
let matching=!limited&&(!/[\.#]/.test(selector)
359359
?node.nodeName.toLowerCase()===selector
360-
:(selector instanceof Function)
360+
:functor(selector)
361361
?selector(this)
362+
:fragment
363+
?node.matches(selector)
362364
:// match selectors on node.
363-
[qualify(qualify(node)),prune.call({"":qualify(selector)},({1:value})=>
365+
[qualify(qualify(node)),prune.call({"":note(qualify(selector))},({1:value})=>
364366
Object.keys(value).every(field=>["id","class"].includes(field))?value:undefined,1,1)
365367
].map(Object.entries).reduce(([[nodename,node]],[[name,selector]])=>
366368
(!name||nodename===name)&&

0 commit comments

Comments
 (0)