XFA - Fix layout issues

- PR #13554 is buggy, so this patch aims to fix bugs.
  - check if a component fits into its parent in taking into account the parent layout.
  - introduce method isSplittable for template nodes to know if a component can be splitted in case of overflow.
This commit is contained in:
Calixte Denizet 2021-06-16 16:02:41 +02:00
parent 326226df45
commit df08b1548b
7 changed files with 337 additions and 232 deletions

View file

@ -60,6 +60,9 @@ describe("XFAFactory", function () {
</subform>
<subform name="second">
<breakBefore targetType="pageArea" startNew="1"/>
<subform>
<draw w="1pt" h="1pt"><value><text>foo</text></value></draw>
</subform>
</subform>
</subform>
</template>
@ -133,7 +136,7 @@ describe("XFAFactory", function () {
<subform name="root" mergeMode="matchTemplate">
<pageSet>
<pageArea>
<contentArea x="123pt" w="456pt" h="789pt"/>
<contentArea x="0pt" w="456pt" h="789pt"/>
<medium stock="default" short="456pt" long="789pt"/>
<field y="1pt" w="11pt" h="22pt" x="2pt">
<ui>
@ -146,6 +149,7 @@ describe("XFAFactory", function () {
</pageArea>
</pageSet>
<subform name="first">
<draw w="1pt" h="1pt"><value><text>foo</text></value></draw>
</subform>
</subform>
</template>