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

@ -168,21 +168,30 @@ function getBBox(data) {
class HTMLResult {
static get FAILURE() {
return shadow(this, "FAILURE", new HTMLResult(false, null, null));
return shadow(this, "FAILURE", new HTMLResult(false, null, null, null));
}
static get EMPTY() {
return shadow(this, "EMPTY", new HTMLResult(true, null, null));
return shadow(this, "EMPTY", new HTMLResult(true, null, null, null));
}
constructor(success, html, bbox) {
constructor(success, html, bbox, breakNode) {
this.success = success;
this.html = html;
this.bbox = bbox;
this.breakNode = breakNode;
}
isBreak() {
return !!this.breakNode;
}
static breakNode(node) {
return new HTMLResult(false, null, null, node);
}
static success(html, bbox = null) {
return new HTMLResult(true, html, bbox);
return new HTMLResult(true, html, bbox, null);
}
}