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:
Tim Ledbetter 2025-06-24 15:35:11 +01:00 committed by Jelle Raaijmakers
parent 8d6f2390f6
commit ff3d3840ac
Notes: github-actions[bot] 2025-06-24 17:56:55 +00:00
12 changed files with 106 additions and 98 deletions

View file

@ -387,10 +387,10 @@ void HTMLScriptElement::prepare_script()
// 4. Set el's from an external file to true.
m_from_an_external_file = true;
// 5. Parse src relative to el's node document.
auto url = document().parse_url(src);
// 5. Let url be the result of encoding-parsing a URL given src, relative to el's node document.
auto url = document().encoding_parse_url(src);
// 6. If the previous step failed, then queue an element task on the DOM manipulation task source given el to fire an event named error at el, and return. Otherwise, let url be the resulting URL record.
// 6. If url is failure, then queue an element task on the DOM manipulation task source given el to fire an event named error at el, and return.
if (!url.has_value()) {
dbgln("HTMLScriptElement: Refusing to run script because the src URL '{}' is invalid.", url);
queue_an_element_task(HTML::Task::Source::DOMManipulation, [this] {