Sha256: bd2f3cd6119334564b90a59e0c0f6f6cca9885dbe0c38f067fe3e28e09d0daac
Contents?: true
Size: 1.42 KB
Versions: 271
Compression:
Stored size: 1.42 KB
Contents
const { text, aria, dom } = axe.commons; const autocomplete = virtualNode.attr('autocomplete'); if (!autocomplete || text.sanitize(autocomplete) === '') { return false; } const nodeName = virtualNode.props.nodeName; if (['textarea', 'input', 'select'].includes(nodeName) === false) { return false; } // The element is an `input` element a `type` of `hidden`, `button`, `submit` or `reset` const excludedInputTypes = ['submit', 'reset', 'button', 'hidden']; if ( nodeName === 'input' && excludedInputTypes.includes(virtualNode.props.type) ) { return false; } // The element has a `disabled` or `aria-disabled="true"` attribute const ariaDisabled = virtualNode.attr('aria-disabled') || 'false'; if (virtualNode.hasAttr('disabled') || ariaDisabled.toLowerCase() === 'true') { return false; } // The element has `tabindex="-1"` and has a [[semantic role]] that is // not a [widget](https://www.w3.org/TR/wai-aria-1.1/#widget_roles) const role = virtualNode.attr('role'); const tabIndex = virtualNode.attr('tabindex'); if (tabIndex === '-1' && role) { const roleDef = aria.lookupTable.role[role]; if (roleDef === undefined || roleDef.type !== 'widget') { return false; } } // The element is **not** visible on the page or exposed to assistive technologies if ( tabIndex === '-1' && virtualNode.actualNode && !dom.isVisible(virtualNode.actualNode, false) && !dom.isVisible(virtualNode.actualNode, true) ) { return false; } return true;
Version data entries
271 entries across 271 versions & 1 rubygems