Merge pull request #17156 from Snuffleupagus/landmark-pageLabel

Update the "aria-label" of the page when a `pageLabel` exists
This commit is contained in:
Jonas Jenwald 2023-10-23 14:33:13 +02:00 committed by GitHub
commit cc18d9749a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {