Commit 21438499 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

CSSConfig: Cache missing values

Iterating over the css data causes performance issues on older machines

Fixes #9820
parent afbfb63a
......@@ -334,6 +334,8 @@ def get_font(self, selector, pre=False):
self._add_to_cache(selector, 'fontdescription', desc)
return desc
self._add_to_cache(selector, 'fontdescription', None)
def _get_description_from_css(self, family, size, style, weight):
if family is None:
......@@ -398,9 +400,9 @@ def get_value(self, selector, attr, pre=False):
# search in default theme
if not pre:
rule = self._get_default_rule(selector, attr)
if rule is not None:
self._add_to_cache(selector, attr,[attr])
value = rule if rule is None else[attr]
self._add_to_cache(selector, attr, value)
return value
def remove_value(self, selector, attr, pre=False):
if attr == StyleAttr.FONT:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment