1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

LibWeb: Remove unecessary dependence on Window from CSS classes

These classes only needed Window to get at its realm. Pass a realm
directly to construct CSS classes.
This commit is contained in:
Andrew Kaster 2022-09-24 16:34:04 -06:00 committed by Linus Groh
parent 8de7e49a56
commit a2ccb00e1d
37 changed files with 159 additions and 146 deletions

View file

@ -24,9 +24,8 @@ class CSSStyleSheet final
WEB_PLATFORM_OBJECT(CSSStyleSheet, StyleSheet);
public:
static CSSStyleSheet* create(HTML::Window&, CSSRuleList& rules, Optional<AK::URL> location);
static CSSStyleSheet* create(JS::Realm&, CSSRuleList& rules, Optional<AK::URL> location);
explicit CSSStyleSheet(HTML::Window&, CSSRuleList&, Optional<AK::URL> location);
virtual ~CSSStyleSheet() override = default;
void set_owner_css_rule(CSSRule* rule) { m_owner_css_rule = rule; }
@ -51,6 +50,8 @@ public:
void set_style_sheet_list(Badge<StyleSheetList>, StyleSheetList*);
private:
CSSStyleSheet(JS::Realm&, CSSRuleList&, Optional<AK::URL> location);
virtual void visit_edges(Cell::Visitor&) override;
CSSRuleList* m_rules { nullptr };