Skip to content

Commit

Permalink
Really increment the cursor when placing unplaced elements
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Apr 24, 2024
1 parent 95611c8 commit 1449ca0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions weasyprint/layout/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,16 +830,17 @@ def grid_layout(context, box, bottom_space, skip_stack, containing_block,
# 2. Increment the cursor’s row position.
row_start = child.style['grid_row_start']
row_end = child.style['grid_row_end']
for y in count(cursor_y):
for cursor_y in count(cursor_y):
if row_start == 'auto':
y, height = _get_placement(
(None, y + 1, None), row_end, rows[::2])
(None, cursor_y + 1, None), row_end, rows[::2])
else:
assert row_start[0] == 'span'
assert row_start == 'auto' or row_start[0] == 'span'
span = _get_span(row_start)
y, height = _get_placement(
row_start, (None, y + 1 + span, None), rows[::2])
row_start, (None, cursor_y + 1 + span, None),
rows[::2])
if y < cursor_y:
continue
for row in range(y, y + height):
Expand Down

0 comments on commit 1449ca0

Please sign in to comment.