Skip to content

Commit

Permalink
Fix wrong resume_at for split floats
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed May 23, 2024
1 parent e6625ed commit 82deda4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion tests/draw/test_float.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ def test_float_split_9(assert_pixels):
<div>bbbbb bb</div>''')


@pytest.mark.xfail
@assert_no_logs
def test_float_split_10(assert_pixels):
assert_pixels('''
Expand Down
3 changes: 2 additions & 1 deletion weasyprint/layout/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ def _out_of_flow_layout(context, box, index, child, new_children,
last_in_flow_child = find_last_in_flow_child(new_children)
page_break = block_level_page_break(last_in_flow_child, child)
resume_at = {index: None}
out_of_flow_resume_at = None
stop = True
if new_children and avoid_page_break(page_break, context):
# Can’t break inside float, find an earlier page break.
Expand All @@ -283,7 +284,7 @@ def _out_of_flow_layout(context, box, index, child, new_children,
if result:
# Earlier page break found, drop whole child rendering.
new_children[:], resume_at = result
new_child = out_of_flow_resume_at = None
new_child = None

# Running element layout.
elif child.is_running():
Expand Down

0 comments on commit 82deda4

Please sign in to comment.