diff options
Diffstat (limited to 'Userland/Libraries')
40 files changed, 70 insertions, 72 deletions
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 <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Window.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventHandler.h> #include <LibWeb/HTML/Scripting/ClassicScript.h> #include <LibWeb/Origin.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> #include <LibWeb/WebAssembly/WebAssemblyObject.h> 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 <LibGfx/Rect.h> #include <LibWeb/CSS/Length.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLHtmlElement.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibWeb/DOM/Element.h> #include <LibWeb/Dump.h> #include <LibWeb/FontCache.h> -#include <LibWeb/Page/BrowsingContext.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <ctype.h> #include <stdio.h> 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 <LibGfx/Palette.h> #include <LibWeb/CSS/StyleValue.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Loader/LoadRequest.h> #include <LibWeb/Loader/ResourceLoader.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> 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 <LibWeb/DOM/Window.h> #include <LibWeb/Dump.h> #include <LibWeb/HTML/AttributeNames.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/HTMLAnchorElement.h> @@ -56,7 +57,6 @@ #include <LibWeb/Layout/TreeBuilder.h> #include <LibWeb/Namespace.h> #include <LibWeb/Origin.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> #include <LibWeb/SVG/TagNames.h> #include <LibWeb/UIEvents/EventNames.h> @@ -300,13 +300,13 @@ void Document::set_title(const String& title) } } -void Document::attach_to_browsing_context(Badge<BrowsingContext>, BrowsingContext& browsing_context) +void Document::attach_to_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext& browsing_context) { m_browsing_context = browsing_context; update_layout(); } -void Document::detach_from_browsing_context(Badge<BrowsingContext>, BrowsingContext& browsing_context) +void Document::detach_from_browsing_context(Badge<HTML::BrowsingContext>, 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>, BrowsingContext&); - void detach_from_browsing_context(Badge<BrowsingContext>, BrowsingContext&); + void attach_to_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&); + void detach_from_browsing_context(Badge<HTML::BrowsingContext>, 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<CSS::StyleSheetList> m_style_sheets; RefPtr<Node> m_hovered_node; RefPtr<Node> m_inspected_node; - WeakPtr<BrowsingContext> m_browsing_context; + WeakPtr<HTML::BrowsingContext> m_browsing_context; AK::URL m_url; RefPtr<Window> 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 <LibWeb/DOM/Text.h> #include <LibWeb/DOMParsing/InnerHTML.h> #include <LibWeb/Geometry/DOMRect.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/Parser/HTMLParser.h> #include <LibWeb/Layout/BlockContainer.h> @@ -32,7 +33,6 @@ #include <LibWeb/Layout/TableRowGroupBox.h> #include <LibWeb/Layout/TreeBuilder.h> #include <LibWeb/Namespace.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibWeb/DOM/EventDispatcher.h> #include <LibWeb/DOM/Timer.h> #include <LibWeb/DOM/Window.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/PageTransitionEvent.h> #include <LibWeb/HighResolutionTime/Performance.h> #include <LibWeb/Layout/InitialContainingBlock.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> #include <LibWeb/Selection/Selection.h> 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 index a2c8933e3d..fb15aa9335 100644 --- a/Userland/Libraries/LibWeb/Page/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -7,15 +7,15 @@ #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/HTMLCollection.h> #include <LibWeb/DOM/Window.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/Layout/BreakNode.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/TextNode.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> -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 index 5243de125c..559a59ffae 100644 --- a/Userland/Libraries/LibWeb/Page/BrowsingContext.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.h @@ -20,7 +20,7 @@ #include <LibWeb/Page/EventHandler.h> #include <LibWeb/TreeNode.h> -namespace Web { +namespace Web::HTML { class BrowsingContext : public TreeNode<BrowsingContext> { 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<Page> m_page; FrameLoader m_loader; - EventHandler m_event_handler; + Web::EventHandler m_event_handler; WeakPtr<HTML::BrowsingContextContainer> m_container; RefPtr<DOM::Document> 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 <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/BrowsingContextContainer.h> #include <LibWeb/Origin.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> 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 <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Window.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HighResolutionTime/Performance.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <AK/StringBuilder.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLInputElement.h> #include <LibWeb/HTML/SubmitEvent.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> #include <LibWeb/URL/URL.h> 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 <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Event.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/Layout/FrameBox.h> #include <LibWeb/Origin.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibWeb/DOM/Event.h> #include <LibWeb/DOM/ShadowRoot.h> #include <LibWeb/DOM/Text.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLInputElement.h> @@ -15,7 +16,6 @@ #include <LibWeb/Layout/ButtonBox.h> #include <LibWeb/Layout/CheckBox.h> #include <LibWeb/Layout/RadioButton.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibGUI/Scrollbar.h> #include <LibGUI/Window.h> #include <LibGfx/ShareableBitmap.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/Parser/HTMLParser.h> #include <LibWeb/InProcessWebView.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/TextNode.h> #include <LibWeb/Loader/ResourceLoader.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/EventHandler.h> #include <LibWeb/Painting/PaintContext.h> #include <LibWeb/UIEvents/MouseEvent.h> 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 <LibWeb/CSS/Length.h> #include <LibWeb/DOM/Node.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockFormattingContext.h> #include <LibWeb/Layout/Box.h> @@ -14,7 +15,6 @@ #include <LibWeb/Layout/ListItemBox.h> #include <LibWeb/Layout/ListItemMarkerBox.h> #include <LibWeb/Layout/ReplacedBox.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibGfx/Painter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLBodyElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/Box.h> #include <LibWeb/Layout/FormattingContext.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Painting/BackgroundPainting.h> #include <LibWeb/Painting/BorderPainting.h> #include <LibWeb/Painting/ShadowPainting.h> 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 <LibGfx/Painter.h> #include <LibGfx/StylePainter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/ButtonBox.h> #include <LibWeb/Layout/Label.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibGfx/Font.h> #include <LibGfx/Painter.h> #include <LibGfx/StylePainter.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/CheckBox.h> #include <LibWeb/Layout/Label.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <AK/Debug.h> #include <LibGfx/Painter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/FrameBox.h> #include <LibWeb/Layout/InitialContainingBlock.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibGfx/FontDatabase.h> #include <LibGfx/Painter.h> #include <LibGfx/StylePainter.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/ImageBox.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLImageElement.h> #include <LibWeb/Layout/ReplacedBox.h> -#include <LibWeb/Page/BrowsingContext.h> namespace Web::Layout { class ImageBox : public ReplacedBox - , public BrowsingContext::ViewportClient { + , public HTML::BrowsingContext::ViewportClient { public: ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, 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 <LibGfx/Painter.h> #include <LibWeb/Dump.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/InitialContainingBlock.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Painting/StackingContext.h> 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 <LibGfx/StylePainter.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Element.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/LabelableNode.h> #include <LibWeb/Layout/TextNode.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibGfx/Painter.h> #include <LibWeb/DOM/Document.h> #include <LibWeb/Dump.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/FormattingContext.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/Node.h> #include <LibWeb/Layout/TextNode.h> -#include <LibWeb/Page/BrowsingContext.h> #include <typeinfo> 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 <LibGfx/Painter.h> #include <LibGfx/StylePainter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/RadioButton.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibWeb/DOM/Node.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/Box.h> #include <LibWeb/Layout/InlineFormattingContext.h> #include <LibWeb/Layout/TableBox.h> @@ -12,7 +13,6 @@ #include <LibWeb/Layout/TableFormattingContext.h> #include <LibWeb/Layout/TableRowBox.h> #include <LibWeb/Layout/TableRowGroupBox.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <AK/StringBuilder.h> #include <LibGfx/Painter.h> #include <LibWeb/DOM/Document.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/InlineFormattingContext.h> #include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/TextNode.h> -#include <LibWeb/Page/BrowsingContext.h> 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 <LibWeb/DOM/Document.h> #include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/Text.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/HTML/Parser/HTMLParser.h> #include <LibWeb/Loader/FrameLoader.h> #include <LibWeb/Loader/ResourceLoader.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/Page.h> namespace Web { static RefPtr<Gfx::Bitmap> 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<Gfx::Bitmap> 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 <LibWeb/DOM/Position.h> #include <LibWeb/DOM/Range.h> #include <LibWeb/DOM/Text.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/LayoutPosition.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/EditEventHandler.h> 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 <LibWeb/DOM/Range.h> #include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Window.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/HTML/HTMLImageElement.h> #include <LibWeb/Layout/InitialContainingBlock.h> -#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/Page.h> #include <LibWeb/UIEvents/EventNames.h> @@ -88,7 +88,7 @@ static Gfx::IntPoint compute_mouse_event_offset(const Gfx::IntPoint& position, c }; } -EventHandler::EventHandler(Badge<BrowsingContext>, BrowsingContext& frame) +EventHandler::EventHandler(Badge<HTML::BrowsingContext>, HTML::BrowsingContext& frame) : m_frame(frame) , m_edit_event_handler(make<EditEventHandler>(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>, BrowsingContext&); + explicit EventHandler(Badge<HTML::BrowsingContext>, 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 <LibWeb/Page/BrowsingContext.h> +#include <LibWeb/HTML/BrowsingContext.h> #include <LibWeb/Page/Page.h> 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<EventHandler>, BrowsingContext& browsing_context) +void Page::set_focused_browsing_context(Badge<EventHandler>, 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<Page*>(this)->focused_context(); } + HTML::BrowsingContext& focused_context(); + HTML::BrowsingContext const& focused_context() const { return const_cast<Page*>(this)->focused_context(); } - void set_focused_browsing_context(Badge<EventHandler>, BrowsingContext&); + void set_focused_browsing_context(Badge<EventHandler>, HTML::BrowsingContext&); void load(const AK::URL&); void load(LoadRequest&); @@ -65,8 +65,8 @@ public: private: PageClient& m_client; - RefPtr<BrowsingContext> m_top_level_browsing_context; - WeakPtr<BrowsingContext> m_focused_context; + RefPtr<HTML::BrowsingContext> m_top_level_browsing_context; + WeakPtr<HTML::BrowsingContext> m_focused_context; // FIXME: Enable this by default once CORS preflight checks are supported. bool m_same_origin_policy_enabled { false }; |