mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-18 23:12:02 +00:00
LibWeb: Replace usages of Document::parse_url()
The spec has been updated to use `encoding_parse_url()` and `encoding_parse_and_serialize_url()` instead.
This commit is contained in:
parent
8d6f2390f6
commit
ff3d3840ac
Notes:
github-actions[bot]
2025-06-24 17:56:55 +00:00
Author: https://github.com/tcl3
Commit: ff3d3840ac
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5201
Reviewed-by: https://github.com/gmta ✅
12 changed files with 106 additions and 98 deletions
|
@ -209,14 +209,15 @@ Optional<URL::URL> NavigableContainer::shared_attribute_processing_steps_for_ifr
|
|||
// 1. Let url be the URL record about:blank.
|
||||
auto url = URL::about_blank();
|
||||
|
||||
// 2. If element has a src attribute specified, and its value is not the empty string,
|
||||
// then parse the value of that attribute relative to element's node document.
|
||||
// If this is successful, then set url to the resulting URL record.
|
||||
// 2. If element has a src attribute specified, and its value is not the empty string, then:
|
||||
auto src_attribute_value = get_attribute_value(HTML::AttributeNames::src);
|
||||
if (!src_attribute_value.is_empty()) {
|
||||
auto parsed_src = document().parse_url(src_attribute_value);
|
||||
if (parsed_src.has_value())
|
||||
url = parsed_src.release_value();
|
||||
// 1. Let maybeURL be the result of encoding-parsing a URL given that attribute's value, relative to element's node document.
|
||||
auto maybe_url = document().encoding_parse_url(src_attribute_value);
|
||||
|
||||
// 2. If maybeURL is not failure, then set url to maybeURL.
|
||||
if (maybe_url.has_value())
|
||||
url = maybe_url.release_value();
|
||||
}
|
||||
|
||||
// 3. If the inclusive ancestor navigables of element's node navigable contains a navigable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue