Skip to content

Commit

Permalink
Reset the bottom space even when we don’t fill the columns
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Apr 25, 2022
1 parent 9641098 commit e5e6b88
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/layout/test_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,37 @@ def test_column_span_8():
assert section.children[0].children[0].text == 'line1'


@assert_no_logs
def test_column_span_9():
page1, = render_pages('''
<style>
@font-face { src: url(weasyprint.otf); font-family: weasyprint }
@page { margin: 0; size: 8px 3px }
body { font-family: weasyprint; font-size: 1px }
div { columns: 2; column-gap: 0; line-height: 1 }
section { column-span: all }
</style>
<div>
abc
<section>line1</section>
def ghi
</div>
''')
html, = page1.children
body, = html.children
div, = body.children
column1, section, column2, column3 = div.children
assert (column1.position_x, column1.position_y) == (0, 0)
assert (section.position_x, section.position_y) == (0, 1)
assert (column2.position_x, column2.position_y) == (0, 2)
assert (column3.position_x, column3.position_y) == (4, 2)

assert column1.children[0].children[0].children[0].text == 'abc'
assert section.children[0].children[0].text == 'line1'
assert column2.children[0].children[0].children[0].text == 'def'
assert column3.children[0].children[0].children[0].text == 'ghi'


@assert_no_logs
def test_columns_multipage():
page1, page2 = render_pages('''
Expand Down
1 change: 1 addition & 0 deletions weasyprint/layout/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ def create_column_box(children):
max_column_height = max(
max_column_height, new_child.margin_height())
if skip_stack is None:
bottom_space = original_bottom_space
break
i += 1
if i == count and not known_height:
Expand Down

0 comments on commit e5e6b88

Please sign in to comment.