Skip to content

Commit

Permalink
Set collapse_border_{...}_width as border_{...}_width used values in …
Browse files Browse the repository at this point in the history
…resolve_percentages
  • Loading branch information
kygoh committed May 25, 2023
1 parent 9e59b20 commit 800a683
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion weasyprint/layout/percent.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ def resolve_percentages(box, containing_block, main_flex_direction=None):
resolve_one_percentage(
box, 'max_height', cb_height, main_flex_direction)

collapse = box.style['border_collapse'] == 'collapse'
# Used value == computed value
for side in ('top', 'right', 'bottom', 'left'):
prop = f'border_{side}_width'
setattr(box, prop, box.style[prop])
if collapse and f'collapse_{prop}' in box.style:
setattr(box, prop, box.style[f'collapse_{prop}'])
else:
setattr(box, prop, box.style[prop])

# Shrink *content* widths and heights according to box-sizing
# Thanks heavens and the spec: Our validator rejects negative values
Expand Down

0 comments on commit 800a683

Please sign in to comment.