Merge pull request #16889 from calixteman/fix_aria_controls_id
Fix the id used in aria-controls used to make a relationship between the popup and its parent
This commit is contained in:
commit
14b2a31e78
@ -1954,7 +1954,10 @@ class PopupAnnotationElement extends AnnotationElement {
|
||||
element.addHighlightArea();
|
||||
}
|
||||
|
||||
this.container.setAttribute("aria-controls", elementIds.join(","));
|
||||
this.container.setAttribute(
|
||||
"aria-controls",
|
||||
elementIds.map(id => `${AnnotationPrefix}${id}`).join(",")
|
||||
);
|
||||
|
||||
return this.container;
|
||||
}
|
||||
|
@ -151,6 +151,24 @@ describe("accessibility", () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check the id in aria-controls", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForSelector(".annotationLayer");
|
||||
const stampId = "pdfjs_internal_id_20R";
|
||||
await page.click(`#${stampId}`);
|
||||
|
||||
const controlledId = await page.$eval(
|
||||
"#pdfjs_internal_id_21R",
|
||||
el => document.getElementById(el.getAttribute("aria-controls")).id
|
||||
);
|
||||
expect(controlledId)
|
||||
.withContext(`In ${browserName}`)
|
||||
.toEqual(stampId);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it("must check that the stamp annotation is linked to the struct tree", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
|
Loading…
Reference in New Issue
Block a user