mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-17 07:41:54 +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
|
@ -53,11 +53,12 @@ void SVGScriptElement::process_the_script_element()
|
|||
if (has_attribute(SVG::AttributeNames::href) || has_attribute_ns(Namespace::XLink.to_string(), SVG::AttributeNames::href)) {
|
||||
auto href_value = href()->base_val();
|
||||
|
||||
script_url = document().parse_url(href_value);
|
||||
if (!script_url.is_valid()) {
|
||||
auto maybe_script_url = document().parse_url(href_value);
|
||||
if (!maybe_script_url.has_value()) {
|
||||
dbgln("Invalid script URL: {}", href_value);
|
||||
return;
|
||||
}
|
||||
script_url = maybe_script_url.release_value();
|
||||
|
||||
auto& vm = realm().vm();
|
||||
auto request = Fetch::Infrastructure::Request::create(vm);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue