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

XFA - Handle correctly nested containers with lr-tb layout (bug 1718670)

- and avoid to push a field with no dimensions when we have some available space in width in a parent.
This commit is contained in:
Calixte Denizet 2021-07-07 15:24:14 +02:00
parent b2b7806cab
commit 8a06df9253
7 changed files with 163 additions and 48 deletions

View file

@ -213,6 +213,7 @@ function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) {
function layoutNode(node, availableSpace) {
let height = null;
let width = null;
let isBroken = false;
if ((!node.w || !node.h) && node.value) {
let marginH = 0;
@ -263,6 +264,7 @@ function layoutNode(node, availableSpace) {
);
width = res.width;
height = res.height;
isBroken = res.isBroken;
} else {
const text = node.value[$text]();
if (text) {
@ -276,6 +278,7 @@ function layoutNode(node, availableSpace) {
);
width = res.width;
height = res.height;
isBroken = res.isBroken;
}
}
@ -287,7 +290,7 @@ function layoutNode(node, availableSpace) {
height += marginV;
}
}
return [width, height];
return { w: width, h: height, isBroken };
}
function computeBbox(node, html, availableSpace) {