mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:07:35 +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:
parent
2b78e227f2
commit
4629f2e4ad
54 changed files with 236 additions and 225 deletions
|
@ -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;
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
|
||||
bool in_quirks_mode() const;
|
||||
DOM::Document* document() const { return m_document; }
|
||||
URL complete_url(String const&) const;
|
||||
AK::URL complete_url(String const&) const;
|
||||
|
||||
PropertyID current_property_id() const { return m_current_property_id; }
|
||||
void set_current_property_id(PropertyID property_id) { m_current_property_id = property_id; }
|
||||
|
@ -172,7 +172,7 @@ private:
|
|||
static Optional<float> try_parse_float(StringView string);
|
||||
static Optional<Color> parse_color(ParsingContext const&, StyleComponentValueRule const&);
|
||||
static Optional<Length> parse_length(ParsingContext const&, StyleComponentValueRule const&);
|
||||
static Optional<URL> parse_url_function(ParsingContext const&, StyleComponentValueRule const&);
|
||||
static Optional<AK::URL> parse_url_function(ParsingContext const&, StyleComponentValueRule const&);
|
||||
|
||||
Result<NonnullRefPtr<StyleValue>, ParsingResult> parse_css_value(PropertyID, TokenStream<StyleComponentValueRule>&);
|
||||
static RefPtr<StyleValue> parse_css_value(ParsingContext const&, StyleComponentValueRule const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue