(el)
| 3473 | } |
| 3474 | |
| 3475 | function documentRefForElement(el) { |
| 3476 | if (!el || el.nodeType !== 1) return null; |
| 3477 | const parts = []; |
| 3478 | let cur = el; |
| 3479 | while (cur && cur.nodeType === 1) { |
| 3480 | const tag = cur.tagName.toLowerCase(); |
| 3481 | if (tag === 'html') break; |
| 3482 | if (tag === 'body') { |
| 3483 | parts.unshift('body'); |
| 3484 | break; |
| 3485 | } |
| 3486 | parts.unshift(documentRefSegment(cur)); |
| 3487 | cur = cur.parentElement; |
| 3488 | } |
| 3489 | return parts.join('>') || null; |
| 3490 | } |
| 3491 | |
| 3492 | function documentRefSegment(el) { |
| 3493 | const tag = el.tagName.toLowerCase(); |
no test coverage detected