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

Version Path
govuk_publishing_components-16.25.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.24.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.23.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.22.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.21.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.20.1 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.20.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.19.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.18.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.17.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.16.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.15.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.14.1 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.14.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.13.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.12.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.11.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.10.1 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.10.0 node_modules/axe-core/lib/checks/aria/unsupportedattr.js
govuk_publishing_components-16.9.2 node_modules/axe-core/lib/checks/aria/unsupportedattr.js