1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Add tagged annotations in the structure tree (bug 1850797)

This commit is contained in:
Calixte Denizet 2023-08-30 20:00:05 +02:00
parent 92f7653cfb
commit d185db2b70
10 changed files with 152 additions and 47 deletions

View file

@ -139,4 +139,35 @@ describe("accessibility", () => {
);
});
});
describe("Stamp annotation accessibility", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("tagged_stamp.pdf", ".annotationLayer");
});
afterAll(async () => {
await closePages(pages);
});
it("must check that the stamp annotation is linked to the struct tree", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.waitForSelector(".structTree");
const isLinkedToStampAnnotation = await page.$eval(
".structTree [role='figure']",
el =>
document
.getElementById(el.getAttribute("aria-owns"))
.classList.contains("stampAnnotation")
);
expect(isLinkedToStampAnnotation)
.withContext(`In ${browserName}`)
.toEqual(true);
})
);
});
});
});

View file

@ -610,3 +610,4 @@
!annotation_hidden_noview.pdf
!widget_hidden_print.pdf
!empty_protected.pdf
!tagged_stamp.pdf

BIN
test/pdfs/tagged_stamp.pdf Executable file

Binary file not shown.