diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 91373c4d0b..88c788377b 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -29,12 +29,12 @@ #include #include #include +#include #include #include #include #include #include -#include namespace Browser { diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp index e23e69851c..01d290d96b 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -38,10 +38,10 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index a81b293ce5..3462193dee 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -94,6 +94,7 @@ set(SOURCES Dump.cpp FontCache.cpp HTML/AttributeNames.cpp + HTML/BrowsingContext.cpp HTML/BrowsingContextContainer.cpp HTML/CanvasRenderingContext2D.cpp HTML/DOMParser.cpp @@ -242,7 +243,6 @@ set(SOURCES Namespace.cpp NavigationTiming/PerformanceTiming.cpp OutOfProcessWebView.cpp - Page/BrowsingContext.cpp Page/EditEventHandler.cpp Page/EventHandler.cpp Page/Page.cpp diff --git a/Userland/Libraries/LibWeb/CSS/Length.cpp b/Userland/Libraries/LibWeb/CSS/Length.cpp index 80a8aa24d6..2cb999f7b1 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.cpp +++ b/Userland/Libraries/LibWeb/CSS/Length.cpp @@ -11,8 +11,8 @@ #include #include #include +#include #include -#include namespace Web::CSS { diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index bd3684d115..3124b0572d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index b95b767807..114fea2ced 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -9,9 +9,9 @@ #include #include #include +#include #include #include -#include #include namespace Web::CSS { diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 9351418658..c6d5bc1367 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -300,13 +300,13 @@ void Document::set_title(const String& title) } } -void Document::attach_to_browsing_context(Badge, BrowsingContext& browsing_context) +void Document::attach_to_browsing_context(Badge, HTML::BrowsingContext& browsing_context) { m_browsing_context = browsing_context; update_layout(); } -void Document::detach_from_browsing_context(Badge, BrowsingContext& browsing_context) +void Document::detach_from_browsing_context(Badge, HTML::BrowsingContext& browsing_context) { VERIFY(&browsing_context == m_browsing_context); tear_down_layout_tree(); diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index f87f3e6fdb..4c4330cfce 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -120,11 +120,11 @@ public: String title() const; void set_title(const String&); - void attach_to_browsing_context(Badge, BrowsingContext&); - void detach_from_browsing_context(Badge, BrowsingContext&); + void attach_to_browsing_context(Badge, HTML::BrowsingContext&); + void detach_from_browsing_context(Badge, HTML::BrowsingContext&); - BrowsingContext* browsing_context() { return m_browsing_context.ptr(); } - const BrowsingContext* browsing_context() const { return m_browsing_context.ptr(); } + HTML::BrowsingContext* browsing_context() { return m_browsing_context.ptr(); } + HTML::BrowsingContext const* browsing_context() const { return m_browsing_context.ptr(); } Page* page(); const Page* page() const; @@ -339,7 +339,7 @@ private: RefPtr m_style_sheets; RefPtr m_hovered_node; RefPtr m_inspected_node; - WeakPtr m_browsing_context; + WeakPtr m_browsing_context; AK::URL m_url; RefPtr m_window; diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 5b24af6c37..af80164c7c 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/Window.cpp b/Userland/Libraries/LibWeb/DOM/Window.cpp index afff05fabe..67d82dbf58 100644 --- a/Userland/Libraries/LibWeb/DOM/Window.cpp +++ b/Userland/Libraries/LibWeb/DOM/Window.cpp @@ -15,11 +15,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index b19e9c96a6..87b6f13ab5 100644 --- a/Userland/Libraries/LibWeb/Forward.h +++ b/Userland/Libraries/LibWeb/Forward.h @@ -115,6 +115,7 @@ class DOMRectReadOnly; } namespace Web::HTML { +class BrowsingContext; class CanvasRenderingContext2D; class CloseEvent; class DOMParser; @@ -261,7 +262,6 @@ class TextNode; } namespace Web { -class BrowsingContext; class EditEventHandler; class EventHandler; class FrameLoader; diff --git a/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp similarity index 99% rename from Userland/Libraries/LibWeb/Page/BrowsingContext.cpp rename to Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index a2c8933e3d..fb15aa9335 100644 --- a/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -7,15 +7,15 @@ #include #include #include +#include #include #include #include #include #include -#include #include -namespace Web { +namespace Web::HTML { BrowsingContext::BrowsingContext(Page& page, HTML::BrowsingContextContainer* container) : m_page(page) diff --git a/Userland/Libraries/LibWeb/Page/BrowsingContext.h b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h similarity index 95% rename from Userland/Libraries/LibWeb/Page/BrowsingContext.h rename to Userland/Libraries/LibWeb/HTML/BrowsingContext.h index 5243de125c..559a59ffae 100644 --- a/Userland/Libraries/LibWeb/Page/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -20,7 +20,7 @@ #include #include -namespace Web { +namespace Web::HTML { class BrowsingContext : public TreeNode { public: @@ -60,8 +60,8 @@ public: FrameLoader& loader() { return m_loader; } FrameLoader const& loader() const { return m_loader; } - EventHandler& event_handler() { return m_event_handler; } - EventHandler const& event_handler() const { return m_event_handler; } + Web::EventHandler& event_handler() { return m_event_handler; } + Web::EventHandler const& event_handler() const { return m_event_handler; } void scroll_to_anchor(String const&); @@ -112,7 +112,7 @@ private: WeakPtr m_page; FrameLoader m_loader; - EventHandler m_event_handler; + Web::EventHandler m_event_handler; WeakPtr m_container; RefPtr m_active_document; diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp index 5d7b826f07..24e372943b 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp index 1fd5acfb18..4bdd50c33b 100644 --- a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp +++ b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp @@ -10,9 +10,9 @@ #include #include #include +#include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index 3c8e3d59d4..3dac65925f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -6,11 +6,11 @@ #include #include +#include #include #include #include #include -#include #include #include diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 7af50c7cf7..6783e5cce8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -6,10 +6,10 @@ #include #include +#include #include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 9198e864e1..376fbf1199 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -15,7 +16,6 @@ #include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp index 7fa34ca567..dc7361ad12 100644 --- a/Userland/Libraries/LibWeb/InProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp @@ -13,13 +13,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index 84b8796ec2..3f64543913 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -14,7 +15,6 @@ #include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/Box.cpp b/Userland/Libraries/LibWeb/Layout/Box.cpp index 24f470874f..a65433b540 100644 --- a/Userland/Libraries/LibWeb/Layout/Box.cpp +++ b/Userland/Libraries/LibWeb/Layout/Box.cpp @@ -7,12 +7,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp b/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp index c632cb53f5..12c71678af 100644 --- a/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp @@ -9,9 +9,9 @@ #include #include #include +#include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/CheckBox.cpp b/Userland/Libraries/LibWeb/Layout/CheckBox.cpp index 6e8a6c9788..71a87f96ef 100644 --- a/Userland/Libraries/LibWeb/Layout/CheckBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/CheckBox.cpp @@ -8,9 +8,9 @@ #include #include #include +#include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/FrameBox.cpp b/Userland/Libraries/LibWeb/Layout/FrameBox.cpp index 2e3a1d1970..500ef5d9a3 100644 --- a/Userland/Libraries/LibWeb/Layout/FrameBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/FrameBox.cpp @@ -7,9 +7,9 @@ #include #include #include +#include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/ImageBox.cpp b/Userland/Libraries/LibWeb/Layout/ImageBox.cpp index 28a89d5098..e75673ecef 100644 --- a/Userland/Libraries/LibWeb/Layout/ImageBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ImageBox.cpp @@ -7,8 +7,8 @@ #include #include #include +#include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/ImageBox.h b/Userland/Libraries/LibWeb/Layout/ImageBox.h index e00fe451a9..733c839de0 100644 --- a/Userland/Libraries/LibWeb/Layout/ImageBox.h +++ b/Userland/Libraries/LibWeb/Layout/ImageBox.h @@ -6,15 +6,15 @@ #pragma once +#include #include #include -#include namespace Web::Layout { class ImageBox : public ReplacedBox - , public BrowsingContext::ViewportClient { + , public HTML::BrowsingContext::ViewportClient { public: ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr, const ImageLoader&); virtual ~ImageBox() override; diff --git a/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp b/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp index d8b0a6773b..d8646f7168 100644 --- a/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp +++ b/Userland/Libraries/LibWeb/Layout/InitialContainingBlock.cpp @@ -6,8 +6,8 @@ #include #include +#include #include -#include #include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/Label.cpp b/Userland/Libraries/LibWeb/Layout/Label.cpp index 4d26b59438..80ef0d8a50 100644 --- a/Userland/Libraries/LibWeb/Layout/Label.cpp +++ b/Userland/Libraries/LibWeb/Layout/Label.cpp @@ -9,11 +9,11 @@ #include #include #include +#include #include #include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index 9e4155a4f6..27dfbeaaf1 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -9,13 +9,13 @@ #include #include #include +#include #include #include #include #include #include #include -#include #include namespace Web::Layout { @@ -91,13 +91,13 @@ HitTestResult Node::hit_test(const Gfx::IntPoint& position, HitTestType type) co return result; } -const BrowsingContext& Node::browsing_context() const +HTML::BrowsingContext const& Node::browsing_context() const { VERIFY(document().browsing_context()); return *document().browsing_context(); } -BrowsingContext& Node::browsing_context() +HTML::BrowsingContext& Node::browsing_context() { VERIFY(document().browsing_context()); return *document().browsing_context(); diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index 9b31685b3b..07bf27a54f 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -65,8 +65,8 @@ public: DOM::Document& document() { return m_document; } const DOM::Document& document() const { return m_document; } - const BrowsingContext& browsing_context() const; - BrowsingContext& browsing_context(); + HTML::BrowsingContext const& browsing_context() const; + HTML::BrowsingContext& browsing_context(); const InitialContainingBlock& root() const; InitialContainingBlock& root(); diff --git a/Userland/Libraries/LibWeb/Layout/RadioButton.cpp b/Userland/Libraries/LibWeb/Layout/RadioButton.cpp index 2c574d0480..d9bf63b580 100644 --- a/Userland/Libraries/LibWeb/Layout/RadioButton.cpp +++ b/Userland/Libraries/LibWeb/Layout/RadioButton.cpp @@ -8,9 +8,9 @@ #include #include #include +#include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 85d4396bcd..d3719304ac 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -12,7 +13,6 @@ #include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.cpp b/Userland/Libraries/LibWeb/Layout/TextNode.cpp index 2fd2ebdccc..d4155bff34 100644 --- a/Userland/Libraries/LibWeb/Layout/TextNode.cpp +++ b/Userland/Libraries/LibWeb/Layout/TextNode.cpp @@ -8,11 +8,11 @@ #include #include #include +#include #include #include #include #include -#include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 50d9d8075b..60d8a7be45 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -13,18 +13,18 @@ #include #include #include +#include #include #include #include #include -#include #include namespace Web { static RefPtr s_default_favicon_bitmap; -FrameLoader::FrameLoader(BrowsingContext& browsing_context) +FrameLoader::FrameLoader(HTML::BrowsingContext& browsing_context) : m_browsing_context(browsing_context) { if (!s_default_favicon_bitmap) { diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.h b/Userland/Libraries/LibWeb/Loader/FrameLoader.h index 277e5a9ab4..1e80d6f72e 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.h +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.h @@ -23,7 +23,7 @@ public: IFrame, }; - explicit FrameLoader(BrowsingContext&); + explicit FrameLoader(HTML::BrowsingContext&); ~FrameLoader(); bool load(const AK::URL&, Type); @@ -31,8 +31,8 @@ public: void load_html(StringView, const AK::URL&); - BrowsingContext& browsing_context() { return m_browsing_context; } - const BrowsingContext& browsing_context() const { return m_browsing_context; } + HTML::BrowsingContext& browsing_context() { return m_browsing_context; } + HTML::BrowsingContext const& browsing_context() const { return m_browsing_context; } private: // ^ResourceClient @@ -43,7 +43,7 @@ private: void load_favicon(RefPtr bitmap = nullptr); bool parse_document(DOM::Document&, const ByteBuffer& data); - BrowsingContext& m_browsing_context; + HTML::BrowsingContext& m_browsing_context; size_t m_redirects_count { 0 }; }; diff --git a/Userland/Libraries/LibWeb/Page/EditEventHandler.cpp b/Userland/Libraries/LibWeb/Page/EditEventHandler.cpp index f636f7cbf7..6c7f907343 100644 --- a/Userland/Libraries/LibWeb/Page/EditEventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EditEventHandler.cpp @@ -10,9 +10,9 @@ #include #include #include +#include #include #include -#include #include namespace Web { diff --git a/Userland/Libraries/LibWeb/Page/EditEventHandler.h b/Userland/Libraries/LibWeb/Page/EditEventHandler.h index 0ac8827ebf..503ffcb50d 100644 --- a/Userland/Libraries/LibWeb/Page/EditEventHandler.h +++ b/Userland/Libraries/LibWeb/Page/EditEventHandler.h @@ -13,7 +13,7 @@ namespace Web { class EditEventHandler { public: - explicit EditEventHandler(BrowsingContext& frame) + explicit EditEventHandler(HTML::BrowsingContext& frame) : m_frame(frame) { } @@ -25,7 +25,7 @@ public: virtual void handle_insert(DOM::Position, u32 code_point); private: - BrowsingContext& m_frame; + HTML::BrowsingContext& m_frame; }; } diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 2250e86aee..146639c7ac 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -9,11 +9,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -88,7 +88,7 @@ static Gfx::IntPoint compute_mouse_event_offset(const Gfx::IntPoint& position, c }; } -EventHandler::EventHandler(Badge, BrowsingContext& frame) +EventHandler::EventHandler(Badge, HTML::BrowsingContext& frame) : m_frame(frame) , m_edit_event_handler(make(frame)) { diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.h b/Userland/Libraries/LibWeb/Page/EventHandler.h index 86ef6ac2f8..402696036a 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.h +++ b/Userland/Libraries/LibWeb/Page/EventHandler.h @@ -17,11 +17,9 @@ namespace Web { -class BrowsingContext; - class EventHandler { public: - explicit EventHandler(Badge, BrowsingContext&); + explicit EventHandler(Badge, HTML::BrowsingContext&); ~EventHandler(); bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers); @@ -43,7 +41,7 @@ private: Layout::InitialContainingBlock* layout_root(); const Layout::InitialContainingBlock* layout_root() const; - BrowsingContext& m_frame; + HTML::BrowsingContext& m_frame; bool m_in_mouse_selection { false }; diff --git a/Userland/Libraries/LibWeb/Page/Page.cpp b/Userland/Libraries/LibWeb/Page/Page.cpp index 3557a7c078..d033a9a799 100644 --- a/Userland/Libraries/LibWeb/Page/Page.cpp +++ b/Userland/Libraries/LibWeb/Page/Page.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include namespace Web { @@ -12,21 +12,21 @@ namespace Web { Page::Page(PageClient& client) : m_client(client) { - m_top_level_browsing_context = BrowsingContext::create(*this); + m_top_level_browsing_context = HTML::BrowsingContext::create(*this); } Page::~Page() { } -BrowsingContext& Page::focused_context() +HTML::BrowsingContext& Page::focused_context() { if (m_focused_context) return *m_focused_context; return top_level_browsing_context(); } -void Page::set_focused_browsing_context(Badge, BrowsingContext& browsing_context) +void Page::set_focused_browsing_context(Badge, HTML::BrowsingContext& browsing_context) { m_focused_context = browsing_context.make_weak_ptr(); } diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h index 4b5e007204..9939e6644f 100644 --- a/Userland/Libraries/LibWeb/Page/Page.h +++ b/Userland/Libraries/LibWeb/Page/Page.h @@ -34,13 +34,13 @@ public: PageClient& client() { return m_client; } const PageClient& client() const { return m_client; } - Web::BrowsingContext& top_level_browsing_context() { return *m_top_level_browsing_context; } - const Web::BrowsingContext& top_level_browsing_context() const { return *m_top_level_browsing_context; } + HTML::BrowsingContext& top_level_browsing_context() { return *m_top_level_browsing_context; } + HTML::BrowsingContext const& top_level_browsing_context() const { return *m_top_level_browsing_context; } - Web::BrowsingContext& focused_context(); - const Web::BrowsingContext& focused_context() const { return const_cast(this)->focused_context(); } + HTML::BrowsingContext& focused_context(); + HTML::BrowsingContext const& focused_context() const { return const_cast(this)->focused_context(); } - void set_focused_browsing_context(Badge, BrowsingContext&); + void set_focused_browsing_context(Badge, HTML::BrowsingContext&); void load(const AK::URL&); void load(LoadRequest&); @@ -65,8 +65,8 @@ public: private: PageClient& m_client; - RefPtr m_top_level_browsing_context; - WeakPtr m_focused_context; + RefPtr m_top_level_browsing_context; + WeakPtr m_focused_context; // FIXME: Enable this by default once CORS preflight checks are supported. bool m_same_origin_policy_enabled { false }; diff --git a/Userland/Services/WebContent/ClientConnection.cpp b/Userland/Services/WebContent/ClientConnection.cpp index 7787acbf5d..8ec0806c77 100644 --- a/Userland/Services/WebContent/ClientConnection.cpp +++ b/Userland/Services/WebContent/ClientConnection.cpp @@ -18,10 +18,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/Userland/Services/WebContent/PageHost.cpp b/Userland/Services/WebContent/PageHost.cpp index 07036ac4a3..8489c19e65 100644 --- a/Userland/Services/WebContent/PageHost.cpp +++ b/Userland/Services/WebContent/PageHost.cpp @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #include namespace WebContent {