diff --git a/l10n/en-US/viewer.ftl b/l10n/en-US/viewer.ftl index 1d0e9ed02a4bc..895b48fbb855c 100644 --- a/l10n/en-US/viewer.ftl +++ b/l10n/en-US/viewer.ftl @@ -46,6 +46,10 @@ pdfjs-save-button = .title = Save pdfjs-save-button-label = Save +pdfjs-save-button-with-aria-label = + .title = Save + .aria-label = Save + # Used in Firefox for Android as a tooltip for the download button (“download” is a verb). pdfjs-download-button = .title = Download diff --git a/test/integration/viewer_spec.mjs b/test/integration/viewer_spec.mjs index 5c634b40b90b5..a92b9a45afc84 100644 --- a/test/integration/viewer_spec.mjs +++ b/test/integration/viewer_spec.mjs @@ -34,6 +34,30 @@ import { PNG } from "pngjs"; const __dirname = import.meta.dirname; describe("PDF viewer", () => { + describe("Toolbar accessibility", () => { + let pages; + + beforeEach(async () => { + pages = await loadAndWait("tracemonkey.pdf", ".textLayer .endOfContent"); + }); + + afterEach(async () => { + await closePages(pages); + }); + + it("exposes an accessible name for the save button", async () => { + await Promise.all( + pages.map(async ([browserName, page]) => { + const ariaLabel = await page.$eval( + "#downloadButton", + button => button.getAttribute("aria-label") + ); + expect(ariaLabel).withContext(`In ${browserName}`).toEqual("Save"); + }) + ); + }); + }); + describe("EFOpen attachments", () => { let pages; diff --git a/web/viewer.html b/web/viewer.html index 198b2eaeb06f2..cfb4426e9ddc5 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -658,7 +658,7 @@ -