LibURL+LibWeb: Make URL::serialize return a String

Simplifying a bunch of uneeded error handling around the place.
This commit is contained in:
Shannon Booth 2024-12-03 22:31:33 +13:00 committed by Sam Atkins
commit 0fa54c2327
Notes: github-actions[bot] 2024-12-04 16:48:13 +00:00
52 changed files with 88 additions and 103 deletions

View file

@ -36,7 +36,7 @@ WebIDL::ExceptionOr<GC::Ref<CSSStyleSheet>> CSSStyleSheet::construct_impl(JS::Re
// 2. Set sheets location to the base URL of the associated Document for the current principal global object.
auto associated_document = verify_cast<HTML::Window>(HTML::current_principal_global_object()).document();
sheet->set_location(MUST(associated_document->base_url().to_string()));
sheet->set_location(associated_document->base_url().to_string());
// 3. Set sheets stylesheet base URL to the baseURL attribute value from options.
if (options.has_value() && options->base_url.has_value()) {
@ -99,7 +99,7 @@ CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& me
, m_rules(&rules)
{
if (location.has_value())
set_location(MUST(location->to_string()));
set_location(location->to_string());
for (auto& rule : *m_rules)
rule->set_parent_style_sheet(this);