Sha256: c5b4f0cbca0d48b6af741b0a664e9cc24dc88670fe660487a73b393fe2b20e44

Contents?: true

Size: 471 Bytes

Versions: 10

Compression:

Stored size: 471 Bytes

Contents

const parent = axe.commons.dom.getComposedParent(node);
if (!parent) {
	// Can only happen with detached DOM nodes and roots:
	return undefined;
}

const parentTagName = parent.nodeName.toUpperCase();
const parentRole = (parent.getAttribute('role') || '').toLowerCase();

if (parentRole === 'list') {
	return true;
}

if (parentRole && axe.commons.aria.isValidRole(parentRole)) {
	this.data('roleNotValid');
	return false;
}

return ['UL', 'OL'].includes(parentTagName);

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
govuk_publishing_components-21.22.0 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.21.3 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.21.2 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.21.1 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.21.0 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.20.0 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.19.1 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.19.0 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.18.0 node_modules/axe-core/lib/checks/lists/listitem.js
govuk_publishing_components-21.17.0 node_modules/axe-core/lib/checks/lists/listitem.js