LibWeb: Return OptionalNone from DOMURL::parse on failure

This ports one more function away from needing to use the awkward
valid state of the URL class.
This commit is contained in:
Shannon Booth 2025-01-22 17:35:52 +13:00 committed by Sam Atkins
parent b81d6945dc
commit fd27eef0d1
Notes: github-actions[bot] 2025-01-22 12:34:57 +00:00
18 changed files with 63 additions and 65 deletions

View file

@ -167,14 +167,14 @@ void Internals::spoof_current_url(String const& url_string)
{
auto url = DOMURL::parse(url_string);
VERIFY(url.is_valid());
VERIFY(url.has_value());
auto origin = url.origin();
auto origin = url->origin();
auto& window = internals_window();
window.associated_document().set_url(url);
window.associated_document().set_url(url.value());
window.associated_document().set_origin(origin);
HTML::relevant_settings_object(window.associated_document()).creation_url = url;
HTML::relevant_settings_object(window.associated_document()).creation_url = url.release_value();
}
GC::Ref<InternalAnimationTimeline> Internals::create_internal_animation_timeline()