Skip to content

Commit

Permalink
Prevent fallback for font-size:var() from crashing
Browse files Browse the repository at this point in the history
Both, parent_style['font_size'] and INITIAL_VALUES['font_size'], are unitless
integers.
  • Loading branch information
Tontyna committed Oct 23, 2019
1 parent 0bb4e2c commit af78171
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions weasyprint/css/computed_values.py
Original file line number Diff line number Diff line change
@@ -615,6 +615,9 @@ def font_size(computer, name, value):
return keyword_values[-i - 1]
else:
return parent_font_size * 0.8
elif isinstance(value, int):
# Due to improper var() the unit-less parent value can get here
return value
elif value.unit == '%':
return value.value * parent_font_size / 100.
else:

0 comments on commit af78171

Please sign in to comment.