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

JS - Add support for display property

- in annotation_layer, move common properties treatment in a common method instead having duplicated code in each widget.
This commit is contained in:
Calixte Denizet 2021-05-03 18:03:16 +02:00
parent afb8c4fd25
commit af125cd299
6 changed files with 197 additions and 141 deletions

View file

@ -809,6 +809,41 @@ describe("Interaction", () => {
})
);
});
it("must check display", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
for (const [type, vis] of [
["hidden", "hidden"],
["noPrint", "visible"],
["noView", "hidden"],
["visible", "visible"],
]) {
let visibility = await page.$eval(
"#\\35 6R",
el => getComputedStyle(el).visibility
);
await clearInput(page, "#\\35 5R");
await page.type(
"#\\35 5R",
`this.getField("Text2").display = display.${type};`
);
await page.click("[data-annotation-id='57R']");
await page.waitForFunction(
`getComputedStyle(document.querySelector("#\\\\35 6R")).visibility !== "${visibility}"`
);
visibility = await page.$eval(
"#\\35 6R",
el => getComputedStyle(el).visibility
);
expect(visibility).withContext(`In ${browserName}`).toEqual(vis);
}
})
);
});
});
describe("in issue13269.pdf", () => {