mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibWeb: Port Document encoding_parse_url and parse_url to Optional<URL>
This ports two more APIs away from URL::is_valid.
This commit is contained in:
parent
cfe9b7a82b
commit
22a7cd9700
Notes:
github-actions[bot]
2025-01-27 00:04:07 +00:00
Author: https://github.com/shannonbooth
Commit: 22a7cd9700
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3362
Reviewed-by: https://github.com/tcl3 ✅
26 changed files with 135 additions and 107 deletions
|
@ -1385,14 +1385,14 @@ WebIDL::ExceptionOr<void> HTMLInputElement::handle_src_attribute(String const& v
|
|||
auto url = document().encoding_parse_url(value);
|
||||
|
||||
// 2. If url is failure, then return.
|
||||
if (!url.is_valid())
|
||||
if (!url.has_value())
|
||||
return {};
|
||||
|
||||
// 3. Let request be a new request whose URL is url, client is the element's node document's relevant settings
|
||||
// object, destination is "image", initiator type is "input", credentials mode is "include", and whose
|
||||
// use-URL-credentials flag is set.
|
||||
auto request = Fetch::Infrastructure::Request::create(vm);
|
||||
request->set_url(move(url));
|
||||
request->set_url(url.release_value());
|
||||
request->set_client(&document().relevant_settings_object());
|
||||
request->set_destination(Fetch::Infrastructure::Request::Destination::Image);
|
||||
request->set_initiator_type(Fetch::Infrastructure::Request::InitiatorType::Input);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue