mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Don't add attribute 'aria-haspopup' when no popup is rendered for an annotation
and for ink annotations, create the popup after the loop in order to avoid useless elements creation.
This commit is contained in:
parent
5f522d1c60
commit
7c43cb2dae
2 changed files with 36 additions and 12 deletions
|
@ -624,4 +624,34 @@ describe("ResetForm action", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Annotation with empty popup and aria", () => {
|
||||
describe("issue14438.pdf", () => {
|
||||
let pages;
|
||||
|
||||
beforeAll(async () => {
|
||||
pages = await loadAndWait(
|
||||
"highlights.pdf",
|
||||
"[data-annotation-id='693R']"
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await closePages(pages);
|
||||
});
|
||||
|
||||
it("must check that the highlight annotation has no popup and no aria-haspopup attribute", async () => {
|
||||
await Promise.all(
|
||||
pages.map(async ([browserName, page]) => {
|
||||
await page.waitForFunction(
|
||||
// No aria-haspopup attribute,
|
||||
`document.querySelector("[data-annotation-id='693R']").ariaHasPopup === null` +
|
||||
// and no popup.
|
||||
`&& document.querySelector("[data-annotation-id='694R']") === null`
|
||||
);
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue