Sha256: faec00d742bbf364bef9dbf4932ec08f76e090bc9269668827402f12d3a2957d

Contents?: true

Size: 521 Bytes

Versions: 104

Compression:

Stored size: 521 Bytes

Contents

options = options || {};

var missing = [];

if (node.hasAttributes()) {
	var attr,
		role = node.getAttribute('role'),
		required = axe.commons.aria.requiredAttr(role);

	if (Array.isArray(options[role])) {
		required = axe.utils.uniqueArray(options[role], required);
	}
	if (role && required) {
		for (var i = 0, l = required.length; i < l; i++) {
			attr = required[i];
			if (!node.getAttribute(attr)) {
				missing.push(attr);
			}
		}
	}
}

if (missing.length) {
	this.data(missing);
	return false;
}

return true;

Version data entries

104 entries across 104 versions & 1 rubygems

Version Path
govuk_publishing_components-16.9.1 node_modules/axe-core/lib/checks/aria/required-attr.js
govuk_publishing_components-16.9.0 node_modules/axe-core/lib/checks/aria/required-attr.js
govuk_publishing_components-16.8.0 node_modules/axe-core/lib/checks/aria/required-attr.js
govuk_publishing_components-16.7.0 node_modules/axe-core/lib/checks/aria/required-attr.js