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

@ -62,6 +62,7 @@ const $isBindable = Symbol();
const $isDataValue = Symbol();
const $isDescendent = Symbol();
const $isSplittable = Symbol();
const $isThereMoreWidth = Symbol();
const $isTransparent = Symbol();
const $isUsable = Symbol();
const $lastAttribute = Symbol();
@ -185,6 +186,16 @@ class XFAObject {
return false;
}
/**
Return true if this node (typically a container)
can provide more width during layout.
The goal is to help to know what a descendant must
do in case of horizontal overflow.
*/
[$isThereMoreWidth]() {
return false;
}
[$appendChild](child) {
child[_parent] = this;
this[_children].push(child);
@ -1074,6 +1085,7 @@ export {
$isDataValue,
$isDescendent,
$isSplittable,
$isThereMoreWidth,
$isTransparent,
$isUsable,
$namespaceId,