mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
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:
parent
b81d6945dc
commit
fd27eef0d1
Notes:
github-actions[bot]
2025-01-22 12:34:57 +00:00
Author: https://github.com/shannonbooth
Commit: fd27eef0d1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3339
Reviewed-by: https://github.com/AtkinsSJ ✅
18 changed files with 63 additions and 65 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue