Skip to content

Commit

Permalink
Fix check for collapsed-borders mode in preferred margin width
Browse files Browse the repository at this point in the history
  • Loading branch information
kygoh committed May 25, 2023
1 parent d87034f commit d4a79bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions weasyprint/layout/preferred.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,14 @@ def margin_width(box, width, left=True, right=True):
assert style_value.unit == '%'
percentages += style_value.value

collapse = box.style['border_collapse'] == 'collapse'
if left:
if box.style['border_collapse'] and 'collapse_border_left_width' in box.style:
if collapse and 'collapse_border_left_width' in box.style:
width += box.style['collapse_border_left_width']
else:
width += box.style['border_left_width']
if right:
if box.style['border_collapse'] and 'collapse_border_right_width' in box.style:
if collapse and 'collapse_border_right_width' in box.style:
width += box.style['collapse_border_right_width']
else:
width += box.style['border_right_width']
Expand Down

0 comments on commit d4a79bc

Please sign in to comment.