LibWeb: Ensure CSSStyleSheet::css_rules() always returns the same object
Instead of having a method that replaces the stylesheet's CSSRuleList, we now have a method on CSSRuleList to modify it's underlying CSSRules.
This commit is contained in:
parent
811033ec19
commit
d209d5a84f
Notes:
sideshowbarker
2024-07-17 09:48:50 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/d209d5a84f Pull-request: https://github.com/SerenityOS/serenity/pull/23327 Reviewed-by: https://github.com/awesomekling
2 changed files with 2 additions and 1 deletions
|
@ -62,6 +62,8 @@ public:
|
|||
bool evaluate_media_queries(HTML::Window const&);
|
||||
void for_each_effective_keyframes_at_rule(Function<void(CSSKeyframesRule const&)> const& callback) const;
|
||||
|
||||
void set_rules(Badge<CSSStyleSheet>, Vector<JS::NonnullGCPtr<CSSRule>> rules) { m_rules = move(rules); }
|
||||
|
||||
Function<void()> on_change;
|
||||
|
||||
private:
|
||||
|
|
|
@ -44,7 +44,6 @@ public:
|
|||
|
||||
CSSRuleList const& rules() const { return *m_rules; }
|
||||
CSSRuleList& rules() { return *m_rules; }
|
||||
void set_rules(CSSRuleList& rules) { m_rules = &rules; }
|
||||
|
||||
CSSRuleList* css_rules() { return m_rules; }
|
||||
CSSRuleList const* css_rules() const { return m_rules; }
|
||||
|
|
Loading…
Add table
Reference in a new issue