Skip to content

Commit

Permalink
Don't crash when properties needing base URL use var functions
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Sep 10, 2019
1 parent f66df06 commit c790ff2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion weasyprint/css/computed_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ def compute(element, pseudo_type, specified, computed, parent_style,
if computed_value is None:
new_value = None
else:
new_value = PROPERTIES[name.replace('_', '-')](computed_value)
prop = PROPERTIES[name.replace('_', '-')]
if prop.wants_base_url:
new_value = prop(computed_value, base_url)
else:
new_value = prop(computed_value)

# See https://drafts.csswg.org/css-variables/#invalid-variables
if new_value is None:
Expand Down

0 comments on commit c790ff2

Please sign in to comment.