Attach (recommended) or Link to PDF file here:

Configuration:
- Web browser and its version: Firefox 88.0.1
- Operating system and its version: Windows 10.0.19043.985]
- PDF.js version: (commit 706c27b9d4b3b9ff6fc3de82bcf71a0610604a1c) (also tested pr/13473 at 296bbdc4)
- Is a browser extension: N/A

Steps to reproduce the problem:
1. Enable experimental XFA
2. Open PDF
[dir2020-02_form.pdf](https://github.com/mozilla/pdf.js/files/6571084/dir2020-02_form.pdf)

What is the expected behavior? (add screenshot)
Margins of `subforms` (e.g. *General_Election_Information*, *General_Information_Other*) are honored.
![image](https://user-images.githubusercontent.com/7104454/120212605-32066300-c200-11eb-9c66-f2d05c9451ec.png)
What went wrong? (add screenshot)
Margins are not honored. 
![image](https://user-images.githubusercontent.com/7104454/120212535-1ac77580-c200-11eb-8332-9924602ef991.png)

Link to a viewer (if hosted on a site other than mozilla.github.io/pdf.js or as Firefox/Chrome extension):

*/
import { $extra, $flushHTML } from "./xfa_object.js";
import { measureToString } from "./html_utils.js";
/**
 * How layout works ?
 *
 * A container has an initial space (with a width and a height) to fit in,
 * which means that once all the children have been added then
 * the total width/height must be lower than the given ones in
 * the initial space.
 * So if the container has known dimensions and these ones are ok with the
 * space then continue else we return HTMLResult.FAILURE: it's up to the
 * parent to deal with this failure (e.g. if parent layout is lr-tb and
 * we fail to add a child at end of line (lr) then we try to add it on the
 * next line).
 * And then we run through the children, each child gets its initial space
 * in calling its parent $getAvailableSpace method
 * (see _filteredChildrenGenerator and $childrenToHTML in xfa_object.js)
 * then we try to layout child in its space. If everything is ok then we add
 * the result to its parent through $addHTML which will recompute the available
 * space in parent according to its layout property else we return
 * HTMLResult.Failure.
 * Before a failure some children may have been layed out: they've been saved in
 * [$extra].children and [$extra] has properties generator and failingNode
 * in order to save the state where we were before a failure.
 * This [$extra].children property is useful when a container has to be splited.
 * So if a container is unbreakable, we must delete its [$extra] property before
 * returning.
 */
function flushHTML(node) {