-
Notifications
You must be signed in to change notification settings - Fork 779
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
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Closes #645