-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Accessibility: Add localized aria-label to Download button in viewer … #20534
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
base: master
Are you sure you want to change the base?
Accessibility: Add localized aria-label to Download button in viewer … #20534
Conversation
| @@ -1,4 +1,4 @@ | |||
| <!doctype html> | |||
| <!doctype html> | |||
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.
This should be unrelated to the change at hand and should be reverted to keep the patch as small as possible (this is probably a UTF byte order mark added by an editor).
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.
It looks like this is still there in the overall diff.
| type="button" | ||
| tabindex="0" | ||
| data-l10n-id="pdfjs-save-button" | ||
| data-l10n-attrs="title aria-label" |
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.
It's not clear to me why the Download button is treated differently now compared to e.g. the Print button above. If we do this, shouldn't we do this consistently for all buttons instead?
@calixteman Are you aware of any accessibility rules from the UI/UX team around this, since we recently changed the HTML to accomodate for that better?
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.
Thanks for the review!
I reverted the unintended BOM/doctype change and updated the patch so data-l10n-attrs="title aria-label" is applied consistently across icon-only toolbar buttons.
Please let me know if any further adjustments are needed.
…vert unintended BOM change
timvandermeij
left a comment
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.
Looks good to me, with the comments addressed and the commits squashed into one, but I'd like @calixteman to review this too given that I'm not fully familiar with the UI/UX requirements in terms of button accessibility.
Summary
Adds a localized
aria-labelto the Download button in the viewer toolbar to improve accessibility for screenreader users.
Details
Previously, only the
titleattribute was localized, so the button did not expose an accessible name. By addingdata-l10n-attrs="title aria-label", bothtitleandaria-labelare now populated by the localization system,consistent with other toolbar buttons.
Result
Screen readers can now correctly announce the purpose of the Download button.
Fixes: #20473