1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

LibWeb: Add the Web::URL namespace and move URLEncoder to it

This namespace will be used for all interfaces defined in the URL
specification, like URL and URLSearchParams.

This has the unfortunate side-effect of requiring us to use the fully
qualified AK::URL name whenever we want to refer to the AK class, so
this commit also fixes all such references.
This commit is contained in:
Idan Horowitz 2021-09-13 00:33:23 +03:00 committed by Andreas Kling
parent 2b78e227f2
commit 4629f2e4ad
54 changed files with 236 additions and 225 deletions

View file

@ -50,9 +50,9 @@ bool ParsingContext::in_quirks_mode() const
return m_document ? m_document->in_quirks_mode() : false;
}
URL ParsingContext::complete_url(String const& addr) const
AK::URL ParsingContext::complete_url(String const& addr) const
{
return m_document ? m_document->url().complete_url(addr) : URL::create_with_url_or_path(addr);
return m_document ? m_document->url().complete_url(addr) : AK::URL::create_with_url_or_path(addr);
}
template<typename T>
@ -1159,7 +1159,7 @@ Vector<Vector<StyleComponentValueRule>> Parser::parse_a_comma_separated_list_of_
return lists;
}
Optional<URL> Parser::parse_url_function(ParsingContext const& context, StyleComponentValueRule const& component_value)
Optional<AK::URL> Parser::parse_url_function(ParsingContext const& context, StyleComponentValueRule const& component_value)
{
// FIXME: Handle list of media queries. https://www.w3.org/TR/css-cascade-3/#conditional-import
// FIXME: Handle data: urls (RFC2397)
@ -1201,7 +1201,7 @@ RefPtr<CSSRule> Parser::convert_to_rule(NonnullRefPtr<StyleRule> rule)
return {};
} else if (rule->m_name.equals_ignoring_case("import"sv) && !rule->prelude().is_empty()) {
Optional<URL> url;
Optional<AK::URL> url;
for (auto& token : rule->prelude()) {
if (token.is(Token::Type::Whitespace))
continue;