The bug in the code was caused by the page_is_empty variable. It’s useless to
test this variable here because we know that we rendered at least the current
line. It’s not updated earlier, but if it were it would always be True.
This commit also fixes minor bugs in the tests.
Fix#1674.
The metrics and floats roundings seems to be slightly different on different
platforms. Using a lower line-height value should fix the problem everywhere.
Fix#1677.
The previous detection was failing when some cells were empty (or fully
rendered) and when the current rendering position was not overflowing the page.
In this case, the line with empty cells was rendered and was visible for
example when cells had padding.
Removing placeholders is something we have to do when we must discard a part of
the layout that has already been done. It currently removes absolutely
positioned placeholders and footnotes.
The same has to be done with split floats, that’s what this commit is about.
We have to change the structure of the broken_out_of_flow attribute, as we have
to get a reliable way to reach the saved data using from the real element in
the tree. The new structure is thus a dictionary whose keys are the boxes in
the tree (placeholder for absolutes, partial elements for floats) and whose
values are the original_box+parent+resume_at.
Fix#1669.
Fix#1666.
Note that the added test doesn’t test this problem, because the "hash" function
is stable when we use the same process. If someone finds a nice way to solve
this…
Before this commit, when we had to break previously rendered waiting children
in a line, we re-rendered the already-rendered children. That was bad, because
the tree of the children that were already rendered were different from the
original tree, that may include leading spaces for example. It also required a
complex mix of the original resume-at with the original skip-stack.
This new solution includes both the original child (to render it from a fresh
start) and the already-rendered child (to get the previous positions). The
skip-stack mix is now useless, removing a lot of complex code.
This change is scary and will probably break some corner cases. But tests pass,
and a new one has been added to avoid future regressions.
Fix#1638.