mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +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
|
@ -311,12 +311,12 @@ void BrowsingContext::unregister_viewport_client(ViewportClient& client)
|
|||
VERIFY(was_removed);
|
||||
}
|
||||
|
||||
void BrowsingContext::register_frame_nesting(URL const& url)
|
||||
void BrowsingContext::register_frame_nesting(AK::URL const& url)
|
||||
{
|
||||
m_frame_nesting_levels.ensure(url)++;
|
||||
}
|
||||
|
||||
bool BrowsingContext::is_frame_nesting_allowed(URL const& url) const
|
||||
bool BrowsingContext::is_frame_nesting_allowed(AK::URL const& url) const
|
||||
{
|
||||
return m_frame_nesting_levels.get(url).value_or(0) < 3;
|
||||
}
|
||||
|
|
|
@ -93,11 +93,11 @@ public:
|
|||
|
||||
void did_edit(Badge<EditEventHandler>);
|
||||
|
||||
void register_frame_nesting(URL const&);
|
||||
bool is_frame_nesting_allowed(URL const&) const;
|
||||
void register_frame_nesting(AK::URL const&);
|
||||
bool is_frame_nesting_allowed(AK::URL const&) const;
|
||||
|
||||
void set_frame_nesting_levels(HashMap<URL, size_t> frame_nesting_levels) { m_frame_nesting_levels = move(frame_nesting_levels); };
|
||||
HashMap<URL, size_t> const& frame_nesting_levels() const { return m_frame_nesting_levels; }
|
||||
void set_frame_nesting_levels(HashMap<AK::URL, size_t> frame_nesting_levels) { m_frame_nesting_levels = move(frame_nesting_levels); };
|
||||
HashMap<AK::URL, size_t> const& frame_nesting_levels() const { return m_frame_nesting_levels; }
|
||||
|
||||
DOM::Document* container_document();
|
||||
DOM::Document const* container_document() const;
|
||||
|
@ -123,7 +123,7 @@ private:
|
|||
|
||||
HashTable<ViewportClient*> m_viewport_clients;
|
||||
|
||||
HashMap<URL, size_t> m_frame_nesting_levels;
|
||||
HashMap<AK::URL, size_t> m_frame_nesting_levels;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ void Page::set_focused_browsing_context(Badge<EventHandler>, BrowsingContext& br
|
|||
m_focused_context = browsing_context.make_weak_ptr();
|
||||
}
|
||||
|
||||
void Page::load(const URL& url)
|
||||
void Page::load(const AK::URL& url)
|
||||
{
|
||||
top_level_browsing_context().loader().load(url, FrameLoader::Type::Navigation);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ void Page::load(LoadRequest& request)
|
|||
top_level_browsing_context().loader().load(request, FrameLoader::Type::Navigation);
|
||||
}
|
||||
|
||||
void Page::load_html(const StringView& html, const URL& url)
|
||||
void Page::load_html(const StringView& html, const AK::URL& url)
|
||||
{
|
||||
top_level_browsing_context().loader().load_html(html, url);
|
||||
}
|
||||
|
|
|
@ -41,10 +41,10 @@ public:
|
|||
|
||||
void set_focused_browsing_context(Badge<EventHandler>, BrowsingContext&);
|
||||
|
||||
void load(const URL&);
|
||||
void load(const AK::URL&);
|
||||
void load(LoadRequest&);
|
||||
|
||||
void load_html(const StringView&, const URL&);
|
||||
void load_html(const StringView&, const AK::URL&);
|
||||
|
||||
bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
|
||||
bool handle_mousedown(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
|
||||
|
@ -74,18 +74,18 @@ public:
|
|||
virtual Gfx::IntRect screen_rect() const = 0;
|
||||
virtual void page_did_set_document_in_top_level_browsing_context(DOM::Document*) { }
|
||||
virtual void page_did_change_title(const String&) { }
|
||||
virtual void page_did_start_loading(const URL&) { }
|
||||
virtual void page_did_finish_loading(const URL&) { }
|
||||
virtual void page_did_start_loading(const AK::URL&) { }
|
||||
virtual void page_did_finish_loading(const AK::URL&) { }
|
||||
virtual void page_did_change_selection() { }
|
||||
virtual void page_did_request_cursor_change(Gfx::StandardCursor) { }
|
||||
virtual void page_did_request_context_menu(const Gfx::IntPoint&) { }
|
||||
virtual void page_did_request_link_context_menu(const Gfx::IntPoint&, const URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
|
||||
virtual void page_did_request_image_context_menu(const Gfx::IntPoint&, const URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers, const Gfx::Bitmap*) { }
|
||||
virtual void page_did_click_link(const URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
|
||||
virtual void page_did_middle_click_link(const URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
|
||||
virtual void page_did_request_link_context_menu(const Gfx::IntPoint&, const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
|
||||
virtual void page_did_request_image_context_menu(const Gfx::IntPoint&, const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers, const Gfx::Bitmap*) { }
|
||||
virtual void page_did_click_link(const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
|
||||
virtual void page_did_middle_click_link(const AK::URL&, [[maybe_unused]] const String& target, [[maybe_unused]] unsigned modifiers) { }
|
||||
virtual void page_did_enter_tooltip_area(const Gfx::IntPoint&, const String&) { }
|
||||
virtual void page_did_leave_tooltip_area() { }
|
||||
virtual void page_did_hover_link(const URL&) { }
|
||||
virtual void page_did_hover_link(const AK::URL&) { }
|
||||
virtual void page_did_unhover_link() { }
|
||||
virtual void page_did_invalidate(const Gfx::IntRect&) { }
|
||||
virtual void page_did_change_favicon(const Gfx::Bitmap&) { }
|
||||
|
@ -96,8 +96,8 @@ public:
|
|||
virtual void page_did_request_alert(const String&) { }
|
||||
virtual bool page_did_request_confirm(const String&) { return false; }
|
||||
virtual String page_did_request_prompt(const String&, const String&) { return {}; }
|
||||
virtual String page_did_request_cookie(const URL&, Cookie::Source) { return {}; }
|
||||
virtual void page_did_set_cookie(const URL&, const Cookie::ParsedCookie&, Cookie::Source) { }
|
||||
virtual String page_did_request_cookie(const AK::URL&, Cookie::Source) { return {}; }
|
||||
virtual void page_did_set_cookie(const AK::URL&, const Cookie::ParsedCookie&, Cookie::Source) { }
|
||||
|
||||
protected:
|
||||
virtual ~PageClient() = default;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue