1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibWeb: Rename Document::complete_url() => parse_url()

This better matches the spec nomenclature.
This commit is contained in:
Andreas Kling 2021-09-09 18:08:56 +02:00
parent 0839442da5
commit e1fb8bef09
12 changed files with 18 additions and 16 deletions

View file

@ -55,7 +55,7 @@ void HTMLBodyElement::parse_attribute(const FlyString& name, const String& value
if (color.has_value())
document().set_visited_link_color(color.value());
} else if (name.equals_ignoring_case("background")) {
m_background_style_value = CSS::ImageStyleValue::create(document().complete_url(value), const_cast<DOM::Document&>(document()));
m_background_style_value = CSS::ImageStyleValue::create(document().parse_url(value), const_cast<DOM::Document&>(document()));
}
}

View file

@ -75,7 +75,7 @@ void HTMLFormElement::submit_form(RefPtr<HTMLElement> submitter, bool from_submi
return;
}
URL url(document().complete_url(action()));
URL url(document().parse_url(action()));
if (!url.is_valid()) {
dbgln("Failed to submit form: Invalid URL: {}", action());

View file

@ -49,7 +49,7 @@ void HTMLIFrameElement::load_src(const String& value)
if (value.is_null())
return;
auto url = document().complete_url(value);
auto url = document().parse_url(value);
if (!url.is_valid()) {
dbgln("iframe failed to load URL: Invalid URL: {}", value);
return;

View file

@ -65,7 +65,7 @@ void HTMLImageElement::parse_attribute(const FlyString& name, const String& valu
HTMLElement::parse_attribute(name, value);
if (name == HTML::AttributeNames::src && !value.is_empty())
m_image_loader.load(document().complete_url(value));
m_image_loader.load(document().parse_url(value));
}
RefPtr<Layout::Node> HTMLImageElement::create_layout_node()

View file

@ -32,7 +32,7 @@ void HTMLLinkElement::inserted()
HTMLElement::inserted();
if (m_relationship & Relationship::Stylesheet && !(m_relationship & Relationship::Alternate)) {
m_css_loader.load_from_url(document().complete_url(href()));
m_css_loader.load_from_url(document().parse_url(href()));
if (auto sheet = m_css_loader.style_sheet())
document().style_sheets().add_sheet(sheet.release_nonnull());
}

View file

@ -38,7 +38,7 @@ void HTMLObjectElement::parse_attribute(const FlyString& name, const String& val
HTMLElement::parse_attribute(name, value);
if (name == HTML::AttributeNames::data)
m_image_loader.load(document().complete_url(value));
m_image_loader.load(document().parse_url(value));
}
RefPtr<Layout::Node> HTMLObjectElement::create_layout_node()

View file

@ -255,7 +255,7 @@ void HTMLScriptElement::prepare_script()
m_from_an_external_file = true;
// 4. Parse src relative to the element's node document.
auto url = document().complete_url(src);
auto url = document().parse_url(src);
// 5. If the previous step failed, queue a task to fire an event named error at the element, and return. Otherwise, let url be the resulting URL record.
if (!url.is_valid()) {
dbgln("HTMLScriptElement: Refusing to run script because the src URL '{}' is invalid.", url);