Skip to content

Add an accessible name to the save button - #21851

Closed
xjtu-ctgg wants to merge 4 commits into
mozilla:masterfrom
xjtu-ctgg:fix-download-button-aria-label
Closed

xjtu-ctgg wants to merge 4 commits into
mozilla:masterfrom
xjtu-ctgg:fix-download-button-aria-label

Conversation

@xjtu-ctgg

Copy link
Copy Markdown
Contributor

Fixes #20473

The standard viewer's save button uses the localized pdfjs-save-button message, but that message only exposed a tooltip through .title. Add a localized .aria-label so screen reader users receive an accessible name.

The integration test checks the rendered #downloadButton in the viewer and verifies its aria-label.

Tests: node --check test/integration/viewer_spec.mjs (full PDF.js integration tests require the repository dependencies and browser test setup).

@xjtu-ctgg
xjtu-ctgg requested a review from a team as a code owner August 30, 2026 17:36
Copilot AI lite review requested due to automatic review settings August 30, 2026 17:36

This comment was marked as low quality.

Comment thread l10n/en-US/viewer.ftl Outdated
pdfjs-print-button-label = Print
pdfjs-save-button =
.title = Save
.aria-label = Save

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xjtu-ctgg

Copy link
Copy Markdown
Contributor Author

Addressed the localization review: kept pdfjs-save-button unchanged, added the new pdfjs-save-button-with-aria-label ID, and switched the standard viewer button to use it.

@Snuffleupagus

Copy link
Copy Markdown
Collaborator

Sorry, but setting aria-label on just a single button like this seems strange/wrong since you'd expect that other buttons are similarly affected!?
I've tagged the issue with requires-feedback-from-ux-ui, since this seems like something that'd benefit from that before making any changes here (and the patch looks wrong in how it leaves the old l10n-id).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add aria-label to "Download" button in PDF.js viewer

4 participants