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

XFA - Move the fake HTML representation of XFA from the worker to the main thread

- the only goal of this patch is to be able to get synchronously the fake html when printing from firefox:
    - in order to print we need to inject some html in beforeprint callback but we cannot block in waiting for all the pages.
  - from a memory point of view: it doesn't change anything since the fake HTML is deleted in the worker;
  - this way we don't break any assumptions.
This commit is contained in:
Calixte Denizet 2021-05-25 15:50:12 +02:00
parent 9478d2f064
commit 45c3f00a27
5 changed files with 50 additions and 32 deletions

View file

@ -57,7 +57,8 @@ describe("XFAFactory", function () {
expect(factory.numberPages).toEqual(2);
const page1 = factory.getPage(0);
const pages = factory.getPages();
const page1 = pages.children[0];
expect(page1.attributes.style).toEqual({
height: "789px",
width: "456px",
@ -99,7 +100,7 @@ describe("XFAFactory", function () {
// draw element must be on each page.
expect(draw.attributes.style).toEqual(
factory.getPage(1).children[1].children[0].attributes.style
pages.children[1].children[1].children[0].attributes.style
);
});
});