(element)
| 32 | * Check if element is visible to user |
| 33 | */ |
| 34 | export function isElementVisible(element) { |
| 35 | if (!element) return false; |
| 36 | |
| 37 | const style = window.getComputedStyle(element); |
| 38 | const rect = element.getBoundingClientRect(); |
| 39 | |
| 40 | return style.display !== 'none' && |
| 41 | style.visibility !== 'hidden' && |
| 42 | style.opacity !== '0' && |
| 43 | rect.width > 0 && |
| 44 | rect.height > 0 && |
| 45 | (rect.top + rect.height) > 0 && |
| 46 | (rect.left + rect.width) > 0; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * Validate XPath syntax and check if it finds elements |
nothing calls this directly
no outgoing calls
no test coverage detected