Rustdoc accessibility: use an icon for the [-]/[+] controls
This way, we can show the plus and minus buttons on screens, while voice control will read off actual words "Collapse" and "Expand" instead of reading "open brace minus close brace" and "open brace plus close brace". Part of #87059
This commit is contained in:
parent
76d247c00a
commit
c58246efe4
9 changed files with 69 additions and 8 deletions
|
@ -126,13 +126,16 @@ impl Context<'_> {
|
|||
emit: &[EmitType],
|
||||
) -> Result<(), Error> {
|
||||
let tmp;
|
||||
let contents =
|
||||
contents.replace("data-url(minus-17x17.png)", static_files::MINUS_PNG_DATAURL);
|
||||
let contents = contents.replace("data-url(plus-17x17.png)", static_files::PLUS_PNG_DATAURL);
|
||||
let contents = if minify {
|
||||
tmp = if resource.extension() == Some(&OsStr::new("css")) {
|
||||
minifier::css::minify(contents).map_err(|e| {
|
||||
minifier::css::minify(&contents).map_err(|e| {
|
||||
Error::new(format!("failed to minify CSS file: {}", e), resource.path(self))
|
||||
})?
|
||||
} else {
|
||||
minifier::js::minify(contents)
|
||||
minifier::js::minify(&contents)
|
||||
};
|
||||
tmp.as_bytes()
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue