Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for global attributes deprecated in ARIA 1.2 #1503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NiedziolkaMichal
Copy link
Collaborator

Makes attributes aria-disabled, aria-errormessage, aria-haspopup and aria-invalid warn about being deprecated, while used with specific roles. List of roles was generated by following code, run on ARIA 1.3, version of 26 October 2022:

const deprecatedTexts = [...document.querySelectorAll('strong')]
	.filter(e => e.innerText == '(deprecated on this role in ARIA 1.2)');

function addToMap(map, code) {
	const role = code.closest('section.role.notoc')
		.querySelector('h4.role-name>code').innerText;

	const attribute = code.innerText;

	if(!map[attribute]) {
		map[attribute] = [];
	}
	map[attribute].push(role);
	return map;
}

const map = deprecatedTexts
	.map(e => e.parentNode)
	.map(e => e.querySelector('code'))
	.reduce((m, e) => addToMap(m, e), {});

Object.values(map)
	.forEach(e => e.sort())

console.log(map);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant