Skip to content

Commit

Permalink
Discard blocks and tables that don't fit in remaining space
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
liZe committed Aug 2, 2018
1 parent c4802ff commit efd139b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions weasyprint/layout/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,11 +704,7 @@ def block_container_layout(context, box, max_position_y, skip_stack,
new_child.border_box_y() + new_child.border_height())

if (new_position_y > max_position_y and
(new_children or not page_is_empty) and
not (isinstance(child, boxes.TableBox) or (
# For blocks with children do this per child.
isinstance(child, boxes.BlockBox) and
child.children))):
(new_children or not page_is_empty)):
# The child overflows the page area, put it on the
# next page. (But don’t delay whole blocks if eg.
# only the bottom border overflows.)
Expand Down

0 comments on commit efd139b

Please sign in to comment.