function createLine(node, children) {
  return {
    name: "div",
    attributes: {
      class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"],
    },
    children,
  };
}
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.