From 04696080f800c2f551f430f67a58010b00db90e0 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 23 Oct 2023 13:42:06 +0200 Subject: [PATCH] Update the "aria-label" of the page when a `pageLabel` exists Looking at the `PDFThumbnailView.setPageLabel` method you'll see that we update e.g. the "aria-label" of the thumbnail-image for documents that contain (valid) pageLabels. This isn't done in `PDFPageView`, which seems inconsistent, hence this patch. --- web/pdf_page_view.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/pdf_page_view.js b/web/pdf_page_view.js index 68e18a4a1..0c946e1c0 100644 --- a/web/pdf_page_view.js +++ b/web/pdf_page_view.js @@ -1042,6 +1042,11 @@ class PDFPageView { setPageLabel(label) { this.pageLabel = typeof label === "string" ? label : null; + this.div.setAttribute( + "data-l10n-args", + JSON.stringify({ page: this.pageLabel ?? this.id }) + ); + if (this.pageLabel !== null) { this.div.setAttribute("data-page-label", this.pageLabel); } else {