Skip to content

Commit

Permalink
Clear cascaded styles when they're not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
liZe committed Sep 11, 2019
1 parent c0fa009 commit 87133bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions weasyprint/css/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def __init__(self, html, sheets, presentational_hints, target_collector):
root=html.etree_element, parent=element,
base_url=html.base_url, target_collector=target_collector)

# Clear the cascaded styles, we don't need them anymore. Keep the
# dictionary, it is used later for page margins.
self._cascaded_styles.clear()

def __call__(self, element, pseudo_type=None):
style = self._computed_styles.get((element, pseudo_type))

Expand Down

0 comments on commit 87133bc

Please sign in to comment.