Skip to content

Commit

Permalink
Rollup merge of rust-lang#82584 - tazjin:rustdoc-aria, r=GuillaumeGomez
Browse files Browse the repository at this point in the history
Add ARIA role to sidebar toggle in Rustdoc

This indicates that the div is an interactive element, and makes the sidebar toggle "clickable" in assistive technologies.

Example of Vimium after this change has been applied (see the issue mentioned below for a screenshot of before):

![Screenshot of Vimium link hints on a Rustdoc page, indicating that the sidebar toggle is clickable](https://user-images.githubusercontent.com/1552853/109384961-ff935400-78f8-11eb-8199-1d35181aeff0.png)

Fixes rust-lang#82582
  • Loading branch information
Dylan-DPC authored Feb 27, 2021
2 parents b5f5c10 + e026e18 commit a70be0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ crate fn render<T: Print, S: Print>(
<![endif]-->\
{before_content}\
<nav class=\"sidebar\">\
<div class=\"sidebar-menu\">&#9776;</div>\
<div class=\"sidebar-menu\" role=\"button\">&#9776;</div>\
{logo}\
{sidebar}\
</nav>\
Expand Down

0 comments on commit a70be0b

Please sign in to comment.