LibWeb/CSS: Return GC::Ref from style sheet parsing methods

These actually always return a value, despite the `CSSStyleSheet*`
return type. So, make that clearer by returning `GC::Ref<CSSStyleSheet>`
instead. This also means we can remove some ad-hoc error-checking code.
This commit is contained in:
Sam Atkins 2025-04-14 14:04:36 +01:00
commit 9284530a9f
Notes: github-actions[bot] 2025-04-15 08:41:33 +00:00
7 changed files with 12 additions and 19 deletions

View file

@ -30,7 +30,7 @@ public:
No,
Yes,
};
GC::Ptr<CSSStyleSheet> create_a_css_style_sheet(String const& css_text, String type, DOM::Element* owner_node, String media, String title, Alternate, OriginClean, Optional<::URL::URL> location, CSSStyleSheet* parent_style_sheet, CSSRule* owner_rule);
GC::Ref<CSSStyleSheet> create_a_css_style_sheet(String const& css_text, String type, DOM::Element* owner_node, String media, String title, Alternate, OriginClean, Optional<::URL::URL> location, CSSStyleSheet* parent_style_sheet, CSSRule* owner_rule);
Vector<GC::Ref<CSSStyleSheet>> const& sheets() const { return m_sheets; }
Vector<GC::Ref<CSSStyleSheet>>& sheets() { return m_sheets; }