(element)
| 100 | |
| 101 | // Function to check if an element is interactive |
| 102 | function isInteractive(element) { |
| 103 | if (element.nodeName === 'input' && element.attrs.find(attr => attr.name === 'type' && attr.value === 'hidden')) return false |
| 104 | if (interactiveElements.includes(element.nodeName)) return true |
| 105 | if (element.attrs) { |
| 106 | if (element.attrs.find(attr => attr.name === 'contenteditable')) return true |
| 107 | if (element.attrs.find(attr => attr.name === 'tabindex')) return true |
| 108 | const role = element.attrs.find(attr => attr.name === 'role') |
| 109 | if (role && allowedRoles.includes(role.value)) return true |
| 110 | } |
| 111 | return false |
| 112 | } |
| 113 | |
| 114 | function hasMeaningfulText(node) { |
| 115 | if (textElements.includes(node.nodeName)) return true |
no test coverage detected