Skip to content

Commit 5e611b5

Browse files
committed
selector optimization
1 parent 6a9ad67 commit 5e611b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/core/utils/dq-element.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ function getFullPathSelector(elm) {
2424
const element = elm;
2525
const names = [];
2626
while (elm.parentElement && elm.nodeName !== 'BODY') {
27-
if (elm.id) {
27+
if(sourceCache.has(elm)) {
28+
names.unshift(sourceCache.get(elm));
29+
break;
30+
} else if (elm.id) {
2831
names.unshift('#' + elm.getAttribute('id'));
2932
break;
3033
} else {

0 commit comments

Comments
 (0)