Skip to content

Commit e5e6b88

Browse files
committed
Reset the bottom space even when we don’t fill the columns
1 parent 9641098 commit e5e6b88

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

tests/layout/test_column.py

+31
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,37 @@ def test_column_span_8():
386386
assert section.children[0].children[0].text == 'line1'
387387

388388

389+
@assert_no_logs
390+
def test_column_span_9():
391+
page1, = render_pages('''
392+
<style>
393+
@font-face { src: url(weasyprint.otf); font-family: weasyprint }
394+
@page { margin: 0; size: 8px 3px }
395+
body { font-family: weasyprint; font-size: 1px }
396+
div { columns: 2; column-gap: 0; line-height: 1 }
397+
section { column-span: all }
398+
</style>
399+
<div>
400+
abc
401+
<section>line1</section>
402+
def ghi
403+
</div>
404+
''')
405+
html, = page1.children
406+
body, = html.children
407+
div, = body.children
408+
column1, section, column2, column3 = div.children
409+
assert (column1.position_x, column1.position_y) == (0, 0)
410+
assert (section.position_x, section.position_y) == (0, 1)
411+
assert (column2.position_x, column2.position_y) == (0, 2)
412+
assert (column3.position_x, column3.position_y) == (4, 2)
413+
414+
assert column1.children[0].children[0].children[0].text == 'abc'
415+
assert section.children[0].children[0].text == 'line1'
416+
assert column2.children[0].children[0].children[0].text == 'def'
417+
assert column3.children[0].children[0].children[0].text == 'ghi'
418+
419+
389420
@assert_no_logs
390421
def test_columns_multipage():
391422
page1, page2 = render_pages('''

weasyprint/layout/column.py

+1
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ def create_column_box(children):
314314
max_column_height = max(
315315
max_column_height, new_child.margin_height())
316316
if skip_stack is None:
317+
bottom_space = original_bottom_space
317318
break
318319
i += 1
319320
if i == count and not known_height:

0 commit comments

Comments
 (0)