AK+LibURL: Move AK::URL into a new URL library

This URL library ends up being a relatively fundamental base library of
the system, as LibCore depends on LibURL.

This change has two main benefits:
 * Moving AK back more towards being an agnostic library that can
   be used between the kernel and userspace. URL has never really fit
   that description - and is not used in the kernel.
 * URL _should_ depend on LibUnicode, as it needs punnycode support.
   However, it's not really possible to do this inside of AK as it can't
   depend on any external library. This change brings us a little closer
   to being able to do that, but unfortunately we aren't there quite
   yet, as the code generators depend on LibCore.
This commit is contained in:
Shannon Booth 2024-03-18 16:22:27 +13:00 committed by Tim Flynn
parent 21bfa001b1
commit e800605ad3
Notes: sideshowbarker 2024-07-17 04:41:05 +09:00
403 changed files with 1336 additions and 1305 deletions

View file

@ -38,14 +38,14 @@ public:
String aria_properties_state_json;
};
void set_url(Badge<WebContentClient>, URL url) { m_url = move(url); }
URL const& url() const { return m_url; }
void set_url(Badge<WebContentClient>, URL::URL url) { m_url = move(url); }
URL::URL const& url() const { return m_url; }
String const& handle() const { return m_client_state.client_handle; }
void server_did_paint(Badge<WebContentClient>, i32 bitmap_id, Gfx::IntSize size);
void load(URL const&);
void load(URL::URL const&);
void load_html(StringView);
void load_empty_document();
@ -123,16 +123,16 @@ public:
Function<void()> on_activate_tab;
Function<void()> on_close;
Function<void(Gfx::IntPoint screen_position)> on_context_menu_request;
Function<void(const URL&, Gfx::IntPoint screen_position)> on_link_context_menu_request;
Function<void(const URL&, Gfx::IntPoint screen_position, Gfx::ShareableBitmap const&)> on_image_context_menu_request;
Function<void(const URL::URL&, Gfx::IntPoint screen_position)> on_link_context_menu_request;
Function<void(const URL::URL&, Gfx::IntPoint screen_position, Gfx::ShareableBitmap const&)> on_image_context_menu_request;
Function<void(Gfx::IntPoint screen_position, Web::Page::MediaContextMenu const&)> on_media_context_menu_request;
Function<void(const URL&)> on_link_hover;
Function<void(const URL::URL&)> on_link_hover;
Function<void()> on_link_unhover;
Function<void(const URL&, ByteString const& target, unsigned modifiers)> on_link_click;
Function<void(const URL&, ByteString const& target, unsigned modifiers)> on_link_middle_click;
Function<void(const URL::URL&, ByteString const& target, unsigned modifiers)> on_link_click;
Function<void(const URL::URL&, ByteString const& target, unsigned modifiers)> on_link_middle_click;
Function<void(ByteString const&)> on_title_change;
Function<void(const URL&, bool)> on_load_start;
Function<void(const URL&)> on_load_finish;
Function<void(const URL::URL&, bool)> on_load_start;
Function<void(const URL::URL&)> on_load_finish;
Function<void(ByteString const& path, i32)> on_request_file;
Function<void()> on_navigate_back;
Function<void()> on_navigate_forward;
@ -149,7 +149,7 @@ public:
Function<void(String const& message)> on_request_set_prompt_text;
Function<void()> on_request_accept_dialog;
Function<void()> on_request_dismiss_dialog;
Function<void(const URL&, ByteString const&)> on_received_source;
Function<void(const URL::URL&, ByteString const&)> on_received_source;
Function<void(ByteString const&)> on_received_dom_tree;
Function<void(Optional<DOMNodeProperties>)> on_received_dom_node_properties;
Function<void(ByteString const&)> on_received_accessibility_tree;
@ -158,10 +158,10 @@ public:
Function<void(String const&)> on_received_dom_node_html;
Function<void(i32 message_id)> on_received_console_message;
Function<void(i32 start_index, Vector<ByteString> const& message_types, Vector<ByteString> const& messages)> on_received_console_messages;
Function<Vector<Web::Cookie::Cookie>(URL const& url)> on_get_all_cookies;
Function<Optional<Web::Cookie::Cookie>(URL const& url, String const& name)> on_get_named_cookie;
Function<String(const URL& url, Web::Cookie::Source source)> on_get_cookie;
Function<void(const URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie;
Function<Vector<Web::Cookie::Cookie>(URL::URL const& url)> on_get_all_cookies;
Function<Optional<Web::Cookie::Cookie>(URL::URL const& url, String const& name)> on_get_named_cookie;
Function<String(const URL::URL& url, Web::Cookie::Source source)> on_get_cookie;
Function<void(const URL::URL& url, Web::Cookie::ParsedCookie const& cookie, Web::Cookie::Source source)> on_set_cookie;
Function<void(Web::Cookie::Cookie const& cookie)> on_update_cookie;
Function<void(i32 count_waiting)> on_resource_status_change;
Function<void()> on_restore_window;
@ -235,7 +235,7 @@ protected:
bool has_usable_bitmap { false };
} m_client_state;
URL m_url;
URL::URL m_url;
float m_zoom_level { 1.0 };
float m_device_pixel_ratio { 1.0 };