(container)
| 6721 | } |
| 6722 | } |
| 6723 | function getActiveElementInfo(container) { |
| 6724 | let element = document.activeElement; |
| 6725 | const { scrollTop , selectionDirection , selectionEnd , selectionStart } = element; |
| 6726 | const activeElementInfo = { |
| 6727 | childPositions: [], |
| 6728 | scrollTop, |
| 6729 | selectionDirection, |
| 6730 | selectionEnd, |
| 6731 | selectionStart |
| 6732 | }; |
| 6733 | while(element && element !== document.body && element !== container){ |
| 6734 | activeElementInfo.childPositions.unshift(getChildPosition(element)); |
| 6735 | element = element.parentElement; |
| 6736 | } |
| 6737 | if ((element === document.body || element === container) && activeElementInfo.childPositions.length) return activeElementInfo; |
| 6738 | } |
| 6739 | function getChildPosition(element) { |
| 6740 | let childPosition = 0; |
| 6741 | while(element = element.previousElementSibling)childPosition++; |
no test coverage detected