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

[JS] Hide field borders and buttons (#15053)

- Since the border belongs to the section containing the HTML
  counterpart of an annotation, this section must be hidden when
  a JS action requires it;
- it wasn't possible to hide a button in using JS.
This commit is contained in:
Calixte Denizet 2022-06-17 15:20:40 +02:00
parent b8688128e3
commit 7e3941da9d
4 changed files with 64 additions and 3 deletions

View file

@ -1336,4 +1336,56 @@ describe("Interaction", () => {
);
});
});
describe("in issue15053.pdf", () => {
let pages;
beforeAll(async () => {
pages = await loadAndWait("issue15053.pdf", "#\\34 4R");
});
afterAll(async () => {
await closePages(pages);
});
it("must check that a button and text field with a border are hidden", async () => {
await Promise.all(
pages.map(async ([browserName, page]) => {
await page.waitForFunction(
"window.PDFViewerApplication.scriptingReady === true"
);
let visibility = await page.$eval(
"[data-annotation-id='35R']",
el => getComputedStyle(el).visibility
);
expect(visibility)
.withContext(`In ${browserName}`)
.toEqual("visible");
visibility = await page.$eval(
"[data-annotation-id='51R']",
el => getComputedStyle(el).visibility
);
expect(visibility)
.withContext(`In ${browserName}`)
.toEqual("visible");
await page.click("#\\34 4R");
visibility = await page.$eval(
"[data-annotation-id='35R']",
el => getComputedStyle(el).visibility
);
expect(visibility).withContext(`In ${browserName}`).toEqual("hidden");
visibility = await page.$eval(
"[data-annotation-id='51R']",
el => getComputedStyle(el).visibility
);
expect(visibility).withContext(`In ${browserName}`).toEqual("hidden");
})
);
});
});
});

View file

@ -527,3 +527,4 @@
!issue14705.pdf
!bug1771477.pdf
!bug1724918.pdf
!issue15053.pdf

BIN
test/pdfs/issue15053.pdf Executable file

Binary file not shown.