mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
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.
This commit is contained in:
parent
72e6bff8b8
commit
759bfbb572
6 changed files with 6 additions and 12 deletions
|
@ -42,7 +42,7 @@ DOM::ExceptionOr<unsigned> CSSStyleSheet::insert_rule(StringView rule, unsigned
|
|||
|
||||
if (!result.is_exception()) {
|
||||
if (m_style_sheet_list) {
|
||||
m_style_sheet_list->bump_generation();
|
||||
m_style_sheet_list->document().style_computer().invalidate_rule_cache();
|
||||
m_style_sheet_list->document().invalidate_style();
|
||||
}
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ DOM::ExceptionOr<void> CSSStyleSheet::delete_rule(unsigned index)
|
|||
auto result = m_rules->remove_a_css_rule(index);
|
||||
if (!result.is_exception()) {
|
||||
if (m_style_sheet_list) {
|
||||
m_style_sheet_list->bump_generation();
|
||||
m_style_sheet_list->document().style_computer().invalidate_rule_cache();
|
||||
m_style_sheet_list->document().invalidate_style();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue