summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-14 20:31:57 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-15 19:48:19 +0100
commit759bfbb572db2c0389744965cc654e3e762a8172 (patch)
tree2bcfc3b6d31edbe208bb733a30c664569775ecd7 /Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
parent72e6bff8b8e813d968a53fdfdd98a6945d35a210 (diff)
downloadserenity-759bfbb572db2c0389744965cc654e3e762a8172.zip
LibWeb: Use StyleComputer::invalidate_rule_cache() directly everywhere
Get rid of the old, roundabout way of invalidating the rule cache by incrementing the StyleSheetList "generation". Instead, when something wants to invalidate the rule cache, just have it directly invalidate the rule cache. This makes it much easier to see what's happening anyway.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleComputer.cpp')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleComputer.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
index cd4561ee5d..01425724ab 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp
@@ -1071,7 +1071,7 @@ bool PropertyDependencyNode::has_cycles()
void StyleComputer::build_rule_cache_if_needed() const
{
- if (m_rule_cache && m_rule_cache->generation == m_document.style_sheets().generation())
+ if (m_rule_cache)
return;
const_cast<StyleComputer&>(*this).build_rule_cache();
}
@@ -1146,8 +1146,6 @@ void StyleComputer::build_rule_cache()
dbgln(" Other: {}", m_rule_cache->other_rules.size());
dbgln(" Total: {}", num_class_rules + num_id_rules + num_tag_name_rules + m_rule_cache->other_rules.size());
}
-
- m_rule_cache->generation = m_document.style_sheets().generation();
}
void StyleComputer::invalidate_rule_cache()