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

headings rules: Skip headings with a role change #722

Merged
merged 1 commit into from Feb 14, 2018

Conversation

WilcoFiers
Copy link
Contributor

Closes #645

Copy link
Contributor

@marcysutton marcysutton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, Wilco. I left a few comments!

let explicitRoles;
if (node.hasAttribute('role')) {
explicitRoles = node.getAttribute('role').split(/\s+/i)
.filter(axe.commons.aria.isValidRole);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The splitting and filtering here seems like a utility we could reuse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems pretty trivial. I would like us to at some point move towards a stronger getRoles() method, but I think that needs a little more thought, and we should probably have a better idea of how we do accessibility support before we can.

it('should return true on regular headings without roles', function () {
var h1 = document.createElement('h1');
var h2 = document.createElement('h2');
var h3 = document.createElement('h3');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these in-memory elements get cleaned up automatically by the test runner?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but they do by the garbage collector.

@WilcoFiers WilcoFiers merged commit 80ef961 into develop Feb 14, 2018
@dylanb dylanb deleted the heading-matches branch March 8, 2018 19:02
mrtnvh pushed a commit to mrtnvh/axe-core that referenced this pull request Nov 24, 2023
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

2 participants