Sha256: f8550a0fb18587fbdd5bb102f1b917b506c804ebefea5a687b7cb974f35cbee8
Contents?: true
Size: 1005 Bytes
Versions: 104
Compression:
Stored size: 1005 Bytes
Contents
const nodeName = node.nodeName.toUpperCase(); const lookupTable = axe.commons.aria.lookupTable; const role = axe.commons.aria.getRole(node); const unsupportedAttrs = Array.from(node.attributes) .filter(({ name }) => { const attribute = lookupTable.attributes[name]; if (!axe.commons.aria.validateAttr(name)) { return false; } const { unsupported } = attribute; if (typeof unsupported !== 'object') { return !!unsupported; } // validate attributes and conditions (if any) from allowedElement to given node const isException = axe.commons.matches(node, unsupported.exceptions); if (!Object.keys(lookupTable.evaluateRoleForElement).includes(nodeName)) { return !isException; } // evaluate a given aria-role, execute the same return !lookupTable.evaluateRoleForElement[nodeName]({ node, role, out: isException }); }) .map(candidate => candidate.name.toString()); if (unsupportedAttrs.length) { this.data(unsupportedAttrs); return true; } return false;
Version data entries
104 entries across 104 versions & 1 rubygems