Skip to content

Commit

Permalink
Handle auto flex item width in columns
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Feb 4, 2025
1 parent df43456 commit 8aa2848
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions weasyprint/layout/flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,14 @@ def flex_layout(context, box, bottom_space, skip_stack, containing_block,
# to the child bottom margin.
child.margin_bottom += block.collapse_margin(adjoining_margins)
else:
# TODO: We had min_content_width here but I have no idea under
# what circumstance that would be correct.
child.width = new_child.width
if child.width == 'auto':
child.width = min(
max(
min_content_width(context, child, outer=False),
new_child.width),
max_content_width(context, box, outer=False))
else:
child.width = new_child.width

new_flex_line.append((index, child))

Expand Down

0 comments on commit 8aa2848

Please sign in to comment.