-
-
Notifications
You must be signed in to change notification settings - Fork 636
No implicit role for <img>
with alt=""
#504
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
Conversation
I didn't update the test because I am not sure how to test |
The linked document says “no corresponding role” should NOT be used, and that the explicit options are “none” or “presentation”. What are we reading differently? |
The I'd like to see the failing tests fixed so we better understand how this change ripples through the plugin. It might make sense to make it, but I'm not sure yet. |
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.
Comments added above. Please fix the failing tests and then we'll decide if we should proceed with the change.
@othree I see. Yes, that's not technically correct. I agree with the change. |
I updated the test. And found if no 'role' provided. The aria attribute check will always pass. |
@@ -141,23 +141,8 @@ ruleTester.run('role-supports-aria-props', rule, { | |||
// this will have global | |||
{ code: '<link aria-checked />' }, | |||
|
|||
// IMG TESTS - implicit role is `presentation` | |||
{ code: '<img alt="" aria-atomic />' }, | |||
{ code: '<img alt="" aria-busy />' }, |
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.
why remove all these?
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.
Because the implicit role is not presentation
.
The only way to change the role to presentation
is by assigning it in the attribute.
But I didn't see any test case in this file have an assigned role.
All cases are using other ways to switch role, e.g. change value of type
@othree this is great, thank you for the test fixes. I appreciate the punctilious attention to spec detail :) |
Hi, I found the implicit role of
<img>
withalt=""
is incorrect.The document from W3C says it should have the corresponding role.
Ref: https://www.w3.org/TR/html-aria/#docconformance