-
Notifications
You must be signed in to change notification settings - Fork 789
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
fix: better unsupported attribute support for aria-roledescription #1382
Conversation
…d flag from validateAttr
@WilcoFiers |
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.
Please add integration tests for each of the exceptions, and a few for elements that are not an exception, such as input[type=text]
and textarea
.
lib/checks/aria/unsupportedattr.js
Outdated
const unsupported = attribute.unsupported; | ||
|
||
if (typeof unsupported === 'boolean' || !unsupported.exceptions) { | ||
return true; |
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.
Nitpick, rather than checking if unsupported is falsey on line 8, I think this code would be a little easier to read if you check on line 14 if unsupported is not an object, and on line 14 do return !!unsupported
.
lib/checks/aria/unsupportedattr.js
Outdated
} | ||
|
||
// validate attributes and conditions (if any) from allowedElement to given node | ||
let out = axe.commons.matches(node, unsupported.exceptions); |
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.
let out =
-> const isException =
Expand the
unsupported
property of an attribute by allowing certain elements to use the attribute.Closes: #1216
Reviewer checks
Required fields, to be filled out by PR reviewer(s)