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

@ -156,7 +156,7 @@ void CSSImportRule::fetch()
}
auto decoded = decoded_or_error.release_value();
auto* imported_style_sheet = parse_css_stylesheet(Parser::ParsingParams(*strong_this->m_document, parsed_url), decoded, parsed_url, strong_this->m_media_query_list);
auto imported_style_sheet = parse_css_stylesheet(Parser::ParsingParams(*strong_this->m_document, parsed_url), decoded, parsed_url, strong_this->m_media_query_list);
// 5. Set importedStylesheets origin-clean flag to parentStylesheets origin-clean flag.
imported_style_sheet->set_origin_clean(parent_style_sheet->is_origin_clean());
@ -166,7 +166,7 @@ void CSSImportRule::fetch()
imported_style_sheet->set_origin_clean(false);
// 7. Set rules styleSheet to importedStylesheet.
strong_this->set_style_sheet(*imported_style_sheet);
strong_this->set_style_sheet(imported_style_sheet);
});
}