mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 17:28:30 +00:00
LibWeb: Use correct URL parsing methods throughout LibWeb
There are essentially 3 URL parsing AOs defined by the spec: 1. Parse a URL 2. Encoding parse a URL 3. Encoding parse a URL and serialize the result Further, these are replicated between the Document and the ESO. This patch defines these methods in accordance with the spec and updates existing users to invoke the correct method. In places where the correct method is ambiguous, we use the encoding parser to preserve existing ad- hoc behavior.
This commit is contained in:
@@ -137,7 +137,7 @@ String HTMLObjectElement::data() const
|
||||
if (!data.has_value())
|
||||
return {};
|
||||
|
||||
return document().parse_url(*data).to_string();
|
||||
return document().encoding_parse_url(*data).to_string();
|
||||
}
|
||||
|
||||
GC::Ptr<Layout::Node> HTMLObjectElement::create_layout_node(CSS::StyleProperties style)
|
||||
@@ -401,7 +401,7 @@ void HTMLObjectElement::load_image()
|
||||
{
|
||||
// NOTE: This currently reloads the image instead of reusing the resource we've already downloaded.
|
||||
auto data = get_attribute_value(HTML::AttributeNames::data);
|
||||
auto url = document().parse_url(data);
|
||||
auto url = document().encoding_parse_url(data);
|
||||
m_resource_request = HTML::SharedResourceRequest::get_or_create(realm(), document().page(), url);
|
||||
m_resource_request->add_callbacks(
|
||||
[this] {
|
||||
|
||||
Reference in New Issue
Block a user