1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 15:47:57 +02:00

Don't print hidden annotatons (bug 1815196)

and handle correctly the NoView and NoPrint flags when they're changed
from JS.
This commit is contained in:
Calixte Denizet 2023-07-30 15:52:27 +02:00
parent 0e6d141edf
commit 71960bea64
9 changed files with 124 additions and 18 deletions

View file

@ -2042,4 +2042,60 @@ describe("Interaction", () => {
);
});
});
describe("in annotation_hidden_noview.pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait(
"annotation_hidden_noview.pdf",
getSelector("11R")
);
});
afterAll(async () => {
await closePages(pages);
});
it("must check that invisible fields are made visible", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.waitForFunction(
"window.PDFViewerApplication.scriptingReady === true"
);
let visibility = await page.$eval(
getSelector("7R"),
el => getComputedStyle(el).visibility
);
expect(visibility).withContext(`In ${browserName}`).toEqual("hidden");
visibility = await page.$eval(
getSelector("8R"),
el => getComputedStyle(el).visibility
);
expect(visibility).withContext(`In ${browserName}`).toEqual("hidden");
await page.click(getSelector("11R"));
await page.waitForTimeout(10);
visibility = await page.$eval(
getSelector("7R"),
el => getComputedStyle(el).visibility
);
expect(visibility)
.withContext(`In ${browserName}`)
.toEqual("visible");
visibility = await page.$eval(
getSelector("8R"),
el => getComputedStyle(el).visibility
);
expect(visibility)
.withContext(`In ${browserName}`)
.toEqual("visible");
})
);
});
});
});