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:
parent
92f7653cfb
commit
d185db2b70
10 changed files with 152 additions and 47 deletions
|
@ -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);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -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
BIN
test/pdfs/tagged_stamp.pdf
Executable file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue