Sha256: bafd3ffdcb8b5b3bed193b07e4dc1a2e08d978aa3e6c4cadbadc22b8fb63d5d0
Contents?: true
Size: 1.17 KB
Versions: 271
Compression:
Stored size: 1.17 KB
Contents
/* * Since this is a best-practice rule, we are filtering elements as dictated by ARIA 1.1 Practices regardless of treatment by browser/AT combinations. * * Info: https://www.w3.org/TR/wai-aria-practices-1.1/#aria_landmark */ var excludedParentsForHeaderFooterLandmarks = [ 'article', 'aside', 'main', 'nav', 'section' ].join(','); function isHeaderFooterLandmark(headerFooterElement) { return !axe.commons.dom.findUpVirtual( headerFooterElement, excludedParentsForHeaderFooterLandmarks ); } function isLandmarkVirtual(virtualNode) { var { actualNode } = virtualNode; var landmarkRoles = axe.commons.aria.getRolesByType('landmark'); var role = axe.commons.aria.getRole(actualNode); if (!role) { return false; } var nodeName = actualNode.nodeName.toUpperCase(); if (nodeName === 'HEADER' || nodeName === 'FOOTER') { return isHeaderFooterLandmark(virtualNode); } if (nodeName === 'SECTION' || nodeName === 'FORM') { var accessibleText = axe.commons.text.accessibleTextVirtual(virtualNode); return !!accessibleText; } return landmarkRoles.indexOf(role) >= 0 || role === 'region'; } return isLandmarkVirtual(virtualNode) && axe.commons.dom.isVisible(node, true);
Version data entries
271 entries across 271 versions & 1 rubygems