mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +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
|
@ -268,11 +268,11 @@ GC::Ptr<Fetch::Infrastructure::Request> HTMLLinkElement::create_link_request(HTM
|
|||
auto url = DOMURL::parse(options.href, options.base_url);
|
||||
|
||||
// 4. If url is failure, then return null.
|
||||
if (!url.is_valid())
|
||||
if (!url.has_value())
|
||||
return nullptr;
|
||||
|
||||
// 5. Let request be the result of creating a potential-CORS request given url, options's destination, and options's crossorigin.
|
||||
auto request = create_potential_CORS_request(vm(), url, options.destination, options.crossorigin);
|
||||
auto request = create_potential_CORS_request(vm(), *url, options.destination, options.crossorigin);
|
||||
|
||||
// 6. Set request's policy container to options's policy container.
|
||||
request->set_policy_container(options.policy_container);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue