Accessibility fixes (and tests)#1227
Accessibility fixes (and tests)#1227bors-voyager[bot] merged 24 commits intorust-lang:masterfrom sorin-davidoi:small-fixes
Conversation
Labels are hidden, but still accessible for screen readers (https://webaim.org/techniques/css/invisiblecontent/#absolutepositioning).
When using tab to navigate between focusable elements, it does not make sense to have two adjacent links pointing to the same address. Another solution would be to place the img tag inside the second address tag, but that leads to some style issue so I have opted for this approach instead.
Focusable elements should have a focus style, but that is overwritten. This will reuse the style applied on hover for focus.
Browsers which do not support these tags will fallback to interpreting them as divs. Ideally, the nav should be a header with a nav inside, but since the header only contains navigation link, I have omitted it and just used nav.
Will aid screen reader users find the content faster.
Semantically, the crates are sorted by time, so usage of ul is incorrect.
It is important not to break the focus order users expect. https://dequeuniversity.com/rules/axe/2.6/tabindex
Focusable elements need to have a focus style (http://www.outlinenone.com/).
It does not really make sense for it to be the first button in the tab order, since it is not one of the main actions.
| export default { | ||
| rules: { | ||
| 'color-contrast': { | ||
| enabled: false, |
There was a problem hiding this comment.
There are multiple elements that currently fail this test. I have disabled it since I think it needs to be addressed by someone more inclined towards design.
|
I have integrated ember-a11y-testing in order to avoid these problems from appearing again. |
…opment This will prevent the violations from being highlighted on the page, which is annoying since the color-contrast rule is currently disabled during tests and thus a lot of elements would be highlighted. https://github.com/ember-a11y/ember-a11y-testing#development-usage
Screen readers can announce to the user when the section has finished loading. The loaders were missing the alt attribute, but instead of adding it I have moved they to CSS, since the content of the section is not (normally) available to screen readers when aria-busy="true".
| </form> | ||
|
|
||
| <div id="main" class='inner-content'> | ||
| <main id="main" class='inner-content'> |
There was a problem hiding this comment.
This is not ideal since each page should define it's own main - but I'm not familiar enough with the pages and don't have time to go through them all, so I think this is good enough for now.
|
Thank you so much for this!!!!!! I'm taking a look now!! |
| @@ -1,4 +1,4 @@ | |||
| <ul> | |||
| <ol> | |||
There was a problem hiding this comment.
Should keyword-list and category-list be changed to ols too? They're both ordered by popularity, and those components are only used on the home page.
What about crate-downloads-list? This is used on the currently-logged-in user's dashboard and are ordered by recent downloads.
Not sure how far we should go with this in this PR-- there are lists of crates that are just divs rather than uls right now that should also perhaps be ols, like every list of crates (which should always have SOME order) or the list of Latest Updates of crates you're following on your dashboard
There was a problem hiding this comment.
Yes, probably those need to be updated as well. Would rather do it in a follow-up PR if that's OK.
There was a problem hiding this comment.
Yup, that's totally fine!
|
|
||
| <a href='https://github.com/rust-lang/crates.io' class='fork-me'> | ||
| <img src='/assets/forkme.png'/> | ||
| <img src='/assets/forkme.png'/ alt="Fork me on GitHub"> |
There was a problem hiding this comment.
I think the slash after the src attribute is to close the tag, so should go after the alt attribute.
| {{#if (is-clipboard-supported)}} | ||
| {{#copy-button clipboardTarget="#crate-toml" success=(action 'copySuccess') error=(action 'copyError')}} | ||
| {{#copy-button clipboardTarget="#crate-toml" success=(action 'copySuccess') error=(action 'copyError') title="Copy to clipboard"}} | ||
| {{svg-jar "copy" alt="Copy to clipboard"}} |
There was a problem hiding this comment.
The title on the button isn't repetitive with the alt text on the svg inside the button? I really don't know how screenreaders will read this, just wanted to point it out :)
There was a problem hiding this comment.
aXe flagged this as an error, and Orca (the screen reader I test with) didn't read the text from the svg.
| {{/if}} | ||
| </div> | ||
| <div class='authorship'> | ||
| <section class='authorship' aria-label="Authorship"> |
There was a problem hiding this comment.
This class being named "authorship" is kind of... out of date. There's a lot more metadata in this crate than just the author. Not sure what a better label would be- "Crate info"? "Crate metadata"?
| } | ||
|
|
||
| > div { margin: 0 15px; } | ||
| > section { margin: 0 15px; } |
There was a problem hiding this comment.
I think the div on line 146 of this file needs to be updated to a section as well, otherwise the columns on the home page take up a variable amount of width when they should be taking up ~1/3 of the width, which starts happening at this commit.
carols10cents
left a comment
There was a problem hiding this comment.
Thank you so much for doing this important work that has been neglected for far too long!!!! I'm really excited to get these changes in. I just have a few places I commented that need some small tweaks before we can merge, and there's one spot I have a question about how many other places we should be using ol, but I don't necessarily want to hold up this whole PR on those changes if it seems like that'll be a bigger change.
carols10cents
left a comment
There was a problem hiding this comment.
Just one more tiny change :)
| </footer> | ||
|
|
||
| <a href='https://github.com/rust-lang/crates.io' class='fork-me'> | ||
| <img src='/assets/forkme.png'/ alt="Fork me on GitHub"> |
There was a problem hiding this comment.
Just one more thing, github hid my comment on this because I made it on a commit and not the overall diff-- could you move the slash that's now between the src and the alt attributes to the end of the img tag so that it closes the tag? Then this PR should be good to go!
|
bors: r+ |
1227: Accessibility fixes (and tests) r=carols10cents Most commits have a message explaining why I think the change is necessary. Let me know if anything is unclear or if I should follow up with other changes. Shoutout to @chriskrycho for his talk [Becoming a Contributor](https://www.youtube.com/watch?v=Abu2BNixXak) which encouraged me to do this!
Build succeeded |
Most commits have a message explaining why I think the change is necessary. Let me know if anything is unclear or if I should follow up with other changes.
Shoutout to @chriskrycho for his talk Becoming a Contributor which encouraged me to do this!