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

Merge pull request #13328 from calixteman/js_display1

JS - Add support for display property
This commit is contained in:
Brendan Dahl 2021-05-17 08:47:13 -07:00 committed by GitHub
commit 17e9cfcd2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 197 additions and 141 deletions

View file

@ -821,6 +821,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", () => {