The device_size parameter was passed to many layout features, but it was only
used to set default size of replaced boxes with no implicit or explicit size
set. As this case is really rare for printed documents, and as it's also rare
to have printed supports that small, we can remove this "feature".
Moreover, in CSS3-images, another definition called "default object size" is
used to set replaced box size when no size is defined. This size doesn't seem
to be defined for images.
The spec says that we can do what we want to improve the rendering in such
cases. Adding a line would probably give exactly the same rendering as if there
were text, but the difference is so small that there's no need to hack the
formatting structure and keep the fix in 3 small lines during the layout.
Fix#873.
To fix#860 and #851, we decided to move block children a little bit to keep
them in the page. It's a bad idea, because children position is altered (and it
breaks many tests, by the way).
Increasing the allowed max_position_y is a better workaround as it doesn't
move blocks.
Here's another floating point rounding error we have to deal with. The original
issue comes from flex layout, but there are probably plenty of rounding
problems in other flows, so it's safe to put the workaround here.
Fix#851.
Top border is handled by collapsing_with_children set to False when the box is
a flex item. Bottom border is handled at the end of the flex item layout, by
adding the collapsed adjoining margins to the child's bottom border.
Fix#673.
This condition had probably been added a long time ago when layout was done
differently. I don't see why it's there, removing it doesn't break tests and
makes page break before unbreakable blocks that go lower than the end of the
page instead of after.
I may have missed something. If this commit pops out of a git bisect, please
open an issue.
Related to #659 (even if the commit is not related to columns only).
This change gives flex_layout a chance to use block_box_layout, that can handle
more cases (including columns) than block_container_layout witout resetting
size set by flex layout.