mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ protected:
|
|||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
virtual void clear_caches();
|
||||
|
||||
[[nodiscard]] FlyString const& parent_layer_internal_qualified_name() const
|
||||
{
|
||||
if (!m_cached_layer_name.has_value())
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user