Skip to content

Commit

Permalink
Remove useless style from cascaded_styles dictionnary
Browse files Browse the repository at this point in the history
  • Loading branch information
grewn0uille committed Sep 9, 2019
1 parent 87d9e84 commit 871d69a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions weasyprint/css/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ def set_computed_styles(self, element, parent, root=None, pseudo_type=None,
element, cascaded, parent_style, pseudo_type, root_style, base_url,
target_collector)

# The style of marker is deleted when display is different from
# list-item.
if pseudo_type is None:
if computed_styles[element, None]['display'] != 'list-item':
if (element, 'marker') in cascaded_styles:
del cascaded_styles[element, 'marker']

def add_page_declarations(self, page_type):
for sheet, origin, sheet_specificity in self._sheets:
for _rule, selector_list, declarations in sheet.page_rules:
Expand Down

0 comments on commit 871d69a

Please sign in to comment.