In CSS Display Module Level 3, the "display" property gets a long
representation allowing:
- a clear separation between inner and outer display type,
- new supported types (contents, run-in, flow-root…),
- inline list items.
This commit allows the (retrocompatible) new long syntax for "display". It also
supports the "flow-root" value. It doesn’t support values related to ruby, and
it doesn’t support the new "contents" and "run-in" display types.
This work gives the possibility to simplify the code in the block_*_layout
functions, and to improve the overall layout.
Related to #36.
Many operations, including page breaks, require a pointer to a specific
position of the box tree. For example, we used to have this structure to point
to the beginning of the first child of the second child:
(1, (2, None))
We now use:
{1: {2: None}}
This change is the first step to handle parallel flows (see #36). It doesn’t
change anything to the layout for now, but it allows us to store multiple
pointers in the same structure.
The next step is to handle multiple pointers in skip_stack during boxes layout.
It means that most of the *_layout() function need an extra for-loop to manage
multiple skip stacks.
We’ll then need to split new types of boxes: table cells, floats, absolutes…
The previous API wasn’t stateless, as it sometimes required to call
get_intrinsic_size before accessing intrinsic_ratio. The new API offers a
single method to get width, height and ratio.
Images were already embedded once when included in the same stream.
Unfortunately, patterns have their own streams, meaning that a pattern used
multiple times includes the image each time. That’s especially bad for
different boxes using the same background, as backgrounds are drawn as
patterns.
Fix#1414.