mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Port EnvironmentSettings URL Parsing to return Optional<URL>
This commit is contained in:
parent
5f5d18d719
commit
2c8dab36f3
Notes:
github-actions[bot]
2025-02-19 13:03:33 +00:00
Author: https://github.com/shannonbooth
Commit: 2c8dab36f3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3609
Reviewed-by: https://github.com/trflynn89
8 changed files with 25 additions and 25 deletions
|
@ -199,11 +199,11 @@ WebIDL::ExceptionOr<void> History::shared_history_push_replace_state(JS::Value d
|
|||
auto parsed_url = relevant_settings_object(*this).parse_url(url->to_byte_string());
|
||||
|
||||
// 2. If that fails, then throw a "SecurityError" DOMException.
|
||||
if (!parsed_url.is_valid())
|
||||
if (!parsed_url.has_value())
|
||||
return WebIDL::SecurityError::create(realm(), "Cannot pushState or replaceState to incompatible URL"_string);
|
||||
|
||||
// 3. Set newURL to the resulting URL record.
|
||||
new_url = parsed_url;
|
||||
new_url = parsed_url.release_value();
|
||||
|
||||
// 4. If document cannot have its URL rewritten to newURL, then throw a "SecurityError" DOMException.
|
||||
if (!can_have_its_url_rewritten(document, new_url))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue