1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-28 23:28:16 +02:00

XFA - Add support for overflow element

- and fix few bugs:
    - avoid infinite loop when layout the document;
    - avoid confusion between break and layout failure;
    - don't add margin width in tb layout when getting available space.
This commit is contained in:
Calixte Denizet 2021-06-13 18:57:51 +02:00
parent 246d565e3b
commit 0ea5792c86
8 changed files with 237 additions and 134 deletions

View file

@ -23,7 +23,6 @@ import { searchNode } from "./som.js";
const $acceptWhitespace = Symbol();
const $addHTML = Symbol();
const $appendChild = Symbol();
const $break = Symbol();
const $childrenToHTML = Symbol();
const $clean = Symbol();
const $cleanup = Symbol();
@ -342,7 +341,7 @@ class XFAObject {
const availableSpace = this[$getAvailableSpace]();
const res = this[$extra].failingNode[$toHTML](availableSpace);
if (!res.success) {
return false;
return res;
}
if (res.html) {
this[$addHTML](res.html, res.bbox);
@ -357,7 +356,7 @@ class XFAObject {
}
const res = gen.value;
if (!res.success) {
return false;
return res;
}
if (res.html) {
this[$addHTML](res.html, res.bbox);
@ -366,7 +365,7 @@ class XFAObject {
this[$extra].generator = null;
return true;
return HTMLResult.EMPTY;
}
[$setSetAttributes](attributes) {
@ -960,7 +959,6 @@ export {
$acceptWhitespace,
$addHTML,
$appendChild,
$break,
$childrenToHTML,
$clean,
$cleanup,