Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions l10n/en-US/viewer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 24 additions & 0 deletions test/integration/viewer_spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion web/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@
<span data-l10n-id="pdfjs-print-button-label"></span>
</button>

<button id="downloadButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-save-button">
<button id="downloadButton" class="toolbarButton" type="button" tabindex="0" data-l10n-id="pdfjs-save-button-with-aria-label">
<span data-l10n-id="pdfjs-save-button-label"></span>
</button>
</div>
Expand Down