Skip to content

Commit

Permalink
Fix replaced_max_content_width
Browse files Browse the repository at this point in the history
Related to #576.
  • Loading branch information
liZe committed Mar 27, 2018
1 parent 19342fb commit e206165
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions weasyprint/layout/preferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ def replaced_max_content_width(box, outer=True):
width, _ = default_image_sizing(
iwidth, iheight, image.intrinsic_ratio, 'auto', height,
default_width=300, default_height=150)
elif box.style['width'].unit == '%':
# See https://drafts.csswg.org/css-sizing/#intrinsic-contribution
width = 0
else:
assert width.unit == 'px'
width = width.value
Expand Down

0 comments on commit e206165

Please sign in to comment.