mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb/CSS: Clear CSSRule's cached layer name when it is moved
Through the CSSOM, rules can be moved around, and so anything cached (for now just the qualified layer name) needs to be recalculated when that happens. This method is virtual so that other rules will be able to clear their cached data too.
This commit is contained in:
parent
36afff97d1
commit
d935a00413
Notes:
github-actions[bot]
2024-10-17 18:57:27 +00:00
Author: https://github.com/AtkinsSJ
Commit: d935a00413
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1842
Reviewed-by: https://github.com/awesomekling
2 changed files with 9 additions and 0 deletions
|
@ -41,11 +41,18 @@ void CSSRule::set_css_text(StringView)
|
|||
void CSSRule::set_parent_rule(CSSRule* parent_rule)
|
||||
{
|
||||
m_parent_rule = parent_rule;
|
||||
clear_caches();
|
||||
}
|
||||
|
||||
void CSSRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
|
||||
{
|
||||
m_parent_style_sheet = parent_style_sheet;
|
||||
clear_caches();
|
||||
}
|
||||
|
||||
void CSSRule::clear_caches()
|
||||
{
|
||||
m_cached_layer_name.clear();
|
||||
}
|
||||
|
||||
FlyString const& CSSRule::parent_layer_internal_qualified_name_slow_case() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue