Skip to content

Commit 789b80e

Browse files
committed
Only use in flow children to set columns height
1 parent 87d9e84 commit 789b80e

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

weasyprint/layout/columns.py

+17-10
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,23 @@ def create_column_box(children):
165165
continue
166166
column_skip_stack = resume_at
167167

168-
# Get the empty space at the bottom of the column box
169-
empty_space = height - (
170-
new_box.children[-1].position_y - box.content_box_y() +
171-
new_box.children[-1].margin_height())
172-
173-
# Get the minimum size needed to render the next box
174-
next_box, _, _, _, _ = block_box_layout(
175-
context, column_box, box.content_box_y(),
176-
column_skip_stack, containing_block, True, [], [], [])
177-
next_box_size = next_box.children[0].margin_height()
168+
in_flow_children = [
169+
child for child in new_box.children
170+
if child.is_in_normal_flow()]
171+
172+
if in_flow_children:
173+
# Get the empty space at the bottom of the column box
174+
empty_space = height - (
175+
in_flow_children[-1].position_y - box.content_box_y() +
176+
in_flow_children[-1].margin_height())
177+
178+
# Get the minimum size needed to render the next box
179+
next_box, _, _, _, _ = block_box_layout(
180+
context, column_box, box.content_box_y(),
181+
column_skip_stack, containing_block, True, [], [], [])
182+
next_box_size = in_flow_children[0].margin_height()
183+
else:
184+
empty_space = next_box_size = 0
178185

179186
# Append the size needed to render the next box in this
180187
# column.

0 commit comments

Comments
 (0)