1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:08:12 +00:00

LibWeb: Move BrowsingContext into HTML/

Browsing contexts are defined by the HTML specification, so let's move
them into the HTML directory. :^)
This commit is contained in:
Andreas Kling 2021-11-18 15:01:28 +01:00
parent 2b866e3c9b
commit 7c57961c61
43 changed files with 73 additions and 75 deletions

View file

@ -29,12 +29,12 @@
#include <LibGUI/ToolbarContainer.h> #include <LibGUI/ToolbarContainer.h>
#include <LibGUI/Window.h> #include <LibGUI/Window.h>
#include <LibJS/Interpreter.h> #include <LibJS/Interpreter.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h> #include <LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h>
#include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/OutOfProcessWebView.h> #include <LibWeb/OutOfProcessWebView.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Browser { namespace Browser {

View file

@ -38,10 +38,10 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventHandler.h> #include <LibWeb/HTML/EventHandler.h>
#include <LibWeb/HTML/Scripting/ClassicScript.h> #include <LibWeb/HTML/Scripting/ClassicScript.h>
#include <LibWeb/Origin.h> #include <LibWeb/Origin.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/WebAssembly/WebAssemblyObject.h> #include <LibWeb/WebAssembly/WebAssemblyObject.h>

View file

@ -94,6 +94,7 @@ set(SOURCES
Dump.cpp Dump.cpp
FontCache.cpp FontCache.cpp
HTML/AttributeNames.cpp HTML/AttributeNames.cpp
HTML/BrowsingContext.cpp
HTML/BrowsingContextContainer.cpp HTML/BrowsingContextContainer.cpp
HTML/CanvasRenderingContext2D.cpp HTML/CanvasRenderingContext2D.cpp
HTML/DOMParser.cpp HTML/DOMParser.cpp
@ -242,7 +243,6 @@ set(SOURCES
Namespace.cpp Namespace.cpp
NavigationTiming/PerformanceTiming.cpp NavigationTiming/PerformanceTiming.cpp
OutOfProcessWebView.cpp OutOfProcessWebView.cpp
Page/BrowsingContext.cpp
Page/EditEventHandler.cpp Page/EditEventHandler.cpp
Page/EventHandler.cpp Page/EventHandler.cpp
Page/Page.cpp Page/Page.cpp

View file

@ -11,8 +11,8 @@
#include <LibGfx/Rect.h> #include <LibGfx/Rect.h>
#include <LibWeb/CSS/Length.h> #include <LibWeb/CSS/Length.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::CSS { namespace Web::CSS {

View file

@ -18,7 +18,7 @@
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
#include <LibWeb/Dump.h> #include <LibWeb/Dump.h>
#include <LibWeb/FontCache.h> #include <LibWeb/FontCache.h>
#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/HTML/BrowsingContext.h>
#include <ctype.h> #include <ctype.h>
#include <stdio.h> #include <stdio.h>

View file

@ -9,9 +9,9 @@
#include <LibGfx/Palette.h> #include <LibGfx/Palette.h>
#include <LibWeb/CSS/StyleValue.h> #include <LibWeb/CSS/StyleValue.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Loader/LoadRequest.h> #include <LibWeb/Loader/LoadRequest.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
namespace Web::CSS { namespace Web::CSS {

View file

@ -36,6 +36,7 @@
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/Dump.h> #include <LibWeb/Dump.h>
#include <LibWeb/HTML/AttributeNames.h> #include <LibWeb/HTML/AttributeNames.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLAnchorElement.h>
@ -56,7 +57,6 @@
#include <LibWeb/Layout/TreeBuilder.h> #include <LibWeb/Layout/TreeBuilder.h>
#include <LibWeb/Namespace.h> #include <LibWeb/Namespace.h>
#include <LibWeb/Origin.h> #include <LibWeb/Origin.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/SVG/TagNames.h> #include <LibWeb/SVG/TagNames.h>
#include <LibWeb/UIEvents/EventNames.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; m_browsing_context = browsing_context;
update_layout(); 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); VERIFY(&browsing_context == m_browsing_context);
tear_down_layout_tree(); tear_down_layout_tree();

View file

@ -120,11 +120,11 @@ public:
String title() const; String title() const;
void set_title(const String&); void set_title(const String&);
void attach_to_browsing_context(Badge<BrowsingContext>, BrowsingContext&); void attach_to_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
void detach_from_browsing_context(Badge<BrowsingContext>, BrowsingContext&); void detach_from_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
BrowsingContext* browsing_context() { return m_browsing_context.ptr(); } HTML::BrowsingContext* browsing_context() { return m_browsing_context.ptr(); }
const BrowsingContext* browsing_context() const { return m_browsing_context.ptr(); } HTML::BrowsingContext const* browsing_context() const { return m_browsing_context.ptr(); }
Page* page(); Page* page();
const Page* page() const; const Page* page() const;
@ -339,7 +339,7 @@ private:
RefPtr<CSS::StyleSheetList> m_style_sheets; RefPtr<CSS::StyleSheetList> m_style_sheets;
RefPtr<Node> m_hovered_node; RefPtr<Node> m_hovered_node;
RefPtr<Node> m_inspected_node; RefPtr<Node> m_inspected_node;
WeakPtr<BrowsingContext> m_browsing_context; WeakPtr<HTML::BrowsingContext> m_browsing_context;
AK::URL m_url; AK::URL m_url;
RefPtr<Window> m_window; RefPtr<Window> m_window;

View file

@ -21,6 +21,7 @@
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/DOMParsing/InnerHTML.h> #include <LibWeb/DOMParsing/InnerHTML.h>
#include <LibWeb/Geometry/DOMRect.h> #include <LibWeb/Geometry/DOMRect.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/Parser/HTMLParser.h> #include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockContainer.h>
@ -32,7 +33,6 @@
#include <LibWeb/Layout/TableRowGroupBox.h> #include <LibWeb/Layout/TableRowGroupBox.h>
#include <LibWeb/Layout/TreeBuilder.h> #include <LibWeb/Layout/TreeBuilder.h>
#include <LibWeb/Namespace.h> #include <LibWeb/Namespace.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::DOM { namespace Web::DOM {

View file

@ -15,11 +15,11 @@
#include <LibWeb/DOM/EventDispatcher.h> #include <LibWeb/DOM/EventDispatcher.h>
#include <LibWeb/DOM/Timer.h> #include <LibWeb/DOM/Timer.h>
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/PageTransitionEvent.h> #include <LibWeb/HTML/PageTransitionEvent.h>
#include <LibWeb/HighResolutionTime/Performance.h> #include <LibWeb/HighResolutionTime/Performance.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/Selection/Selection.h> #include <LibWeb/Selection/Selection.h>

View file

@ -115,6 +115,7 @@ class DOMRectReadOnly;
} }
namespace Web::HTML { namespace Web::HTML {
class BrowsingContext;
class CanvasRenderingContext2D; class CanvasRenderingContext2D;
class CloseEvent; class CloseEvent;
class DOMParser; class DOMParser;
@ -261,7 +262,6 @@ class TextNode;
} }
namespace Web { namespace Web {
class BrowsingContext;
class EditEventHandler; class EditEventHandler;
class EventHandler; class EventHandler;
class FrameLoader; class FrameLoader;

View file

@ -7,15 +7,15 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/HTMLCollection.h> #include <LibWeb/DOM/HTMLCollection.h>
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLAnchorElement.h>
#include <LibWeb/Layout/BreakNode.h> #include <LibWeb/Layout/BreakNode.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/TextNode.h> #include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
namespace Web { namespace Web::HTML {
BrowsingContext::BrowsingContext(Page& page, HTML::BrowsingContextContainer* container) BrowsingContext::BrowsingContext(Page& page, HTML::BrowsingContextContainer* container)
: m_page(page) : m_page(page)

View file

@ -20,7 +20,7 @@
#include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/EventHandler.h>
#include <LibWeb/TreeNode.h> #include <LibWeb/TreeNode.h>
namespace Web { namespace Web::HTML {
class BrowsingContext : public TreeNode<BrowsingContext> { class BrowsingContext : public TreeNode<BrowsingContext> {
public: public:
@ -60,8 +60,8 @@ public:
FrameLoader& loader() { return m_loader; } FrameLoader& loader() { return m_loader; }
FrameLoader const& loader() const { return m_loader; } FrameLoader const& loader() const { return m_loader; }
EventHandler& event_handler() { return m_event_handler; } Web::EventHandler& event_handler() { return m_event_handler; }
EventHandler const& event_handler() const { return m_event_handler; } Web::EventHandler const& event_handler() const { return m_event_handler; }
void scroll_to_anchor(String const&); void scroll_to_anchor(String const&);
@ -112,7 +112,7 @@ private:
WeakPtr<Page> m_page; WeakPtr<Page> m_page;
FrameLoader m_loader; FrameLoader m_loader;
EventHandler m_event_handler; Web::EventHandler m_event_handler;
WeakPtr<HTML::BrowsingContextContainer> m_container; WeakPtr<HTML::BrowsingContextContainer> m_container;
RefPtr<DOM::Document> m_active_document; RefPtr<DOM::Document> m_active_document;

View file

@ -6,9 +6,9 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/BrowsingContextContainer.h> #include <LibWeb/HTML/BrowsingContextContainer.h>
#include <LibWeb/Origin.h> #include <LibWeb/Origin.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -10,9 +10,9 @@
#include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h> #include <LibWeb/HTML/EventLoop/EventLoop.h>
#include <LibWeb/HighResolutionTime/Performance.h> #include <LibWeb/HighResolutionTime/Performance.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -6,11 +6,11 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLInputElement.h> #include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/HTML/SubmitEvent.h> #include <LibWeb/HTML/SubmitEvent.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/URL/URL.h> #include <LibWeb/URL/URL.h>

View file

@ -6,10 +6,10 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/Layout/FrameBox.h> #include <LibWeb/Layout/FrameBox.h>
#include <LibWeb/Origin.h> #include <LibWeb/Origin.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -8,6 +8,7 @@
#include <LibWeb/DOM/Event.h> #include <LibWeb/DOM/Event.h>
#include <LibWeb/DOM/ShadowRoot.h> #include <LibWeb/DOM/ShadowRoot.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/EventNames.h> #include <LibWeb/HTML/EventNames.h>
#include <LibWeb/HTML/HTMLFormElement.h> #include <LibWeb/HTML/HTMLFormElement.h>
#include <LibWeb/HTML/HTMLInputElement.h> #include <LibWeb/HTML/HTMLInputElement.h>
@ -15,7 +16,6 @@
#include <LibWeb/Layout/ButtonBox.h> #include <LibWeb/Layout/ButtonBox.h>
#include <LibWeb/Layout/CheckBox.h> #include <LibWeb/Layout/CheckBox.h>
#include <LibWeb/Layout/RadioButton.h> #include <LibWeb/Layout/RadioButton.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::HTML { namespace Web::HTML {

View file

@ -13,13 +13,13 @@
#include <LibGUI/Scrollbar.h> #include <LibGUI/Scrollbar.h>
#include <LibGUI/Window.h> #include <LibGUI/Window.h>
#include <LibGfx/ShareableBitmap.h> #include <LibGfx/ShareableBitmap.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLAnchorElement.h>
#include <LibWeb/HTML/Parser/HTMLParser.h> #include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/InProcessWebView.h> #include <LibWeb/InProcessWebView.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/TextNode.h> #include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/EventHandler.h>
#include <LibWeb/Painting/PaintContext.h> #include <LibWeb/Painting/PaintContext.h>
#include <LibWeb/UIEvents/MouseEvent.h> #include <LibWeb/UIEvents/MouseEvent.h>

View file

@ -6,6 +6,7 @@
#include <LibWeb/CSS/Length.h> #include <LibWeb/CSS/Length.h>
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/BlockFormattingContext.h> #include <LibWeb/Layout/BlockFormattingContext.h>
#include <LibWeb/Layout/Box.h> #include <LibWeb/Layout/Box.h>
@ -14,7 +15,6 @@
#include <LibWeb/Layout/ListItemBox.h> #include <LibWeb/Layout/ListItemBox.h>
#include <LibWeb/Layout/ListItemMarkerBox.h> #include <LibWeb/Layout/ListItemMarkerBox.h>
#include <LibWeb/Layout/ReplacedBox.h> #include <LibWeb/Layout/ReplacedBox.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -7,12 +7,12 @@
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLBodyElement.h> #include <LibWeb/HTML/HTMLBodyElement.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/Box.h> #include <LibWeb/Layout/Box.h>
#include <LibWeb/Layout/FormattingContext.h> #include <LibWeb/Layout/FormattingContext.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Painting/BackgroundPainting.h> #include <LibWeb/Painting/BackgroundPainting.h>
#include <LibWeb/Painting/BorderPainting.h> #include <LibWeb/Painting/BorderPainting.h>
#include <LibWeb/Painting/ShadowPainting.h> #include <LibWeb/Painting/ShadowPainting.h>

View file

@ -9,9 +9,9 @@
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibGfx/StylePainter.h> #include <LibGfx/StylePainter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/ButtonBox.h> #include <LibWeb/Layout/ButtonBox.h>
#include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/Label.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -8,9 +8,9 @@
#include <LibGfx/Font.h> #include <LibGfx/Font.h>
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibGfx/StylePainter.h> #include <LibGfx/StylePainter.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/CheckBox.h> #include <LibWeb/Layout/CheckBox.h>
#include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/Label.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -7,9 +7,9 @@
#include <AK/Debug.h> #include <AK/Debug.h>
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/FrameBox.h> #include <LibWeb/Layout/FrameBox.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -7,8 +7,8 @@
#include <LibGfx/FontDatabase.h> #include <LibGfx/FontDatabase.h>
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibGfx/StylePainter.h> #include <LibGfx/StylePainter.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/ImageBox.h> #include <LibWeb/Layout/ImageBox.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -6,15 +6,15 @@
#pragma once #pragma once
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLImageElement.h> #include <LibWeb/HTML/HTMLImageElement.h>
#include <LibWeb/Layout/ReplacedBox.h> #include <LibWeb/Layout/ReplacedBox.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {
class ImageBox class ImageBox
: public ReplacedBox : public ReplacedBox
, public BrowsingContext::ViewportClient { , public HTML::BrowsingContext::ViewportClient {
public: public:
ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, const ImageLoader&); ImageBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>, const ImageLoader&);
virtual ~ImageBox() override; virtual ~ImageBox() override;

View file

@ -6,8 +6,8 @@
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibWeb/Dump.h> #include <LibWeb/Dump.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Painting/StackingContext.h> #include <LibWeb/Painting/StackingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -9,11 +9,11 @@
#include <LibGfx/StylePainter.h> #include <LibGfx/StylePainter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/Element.h> #include <LibWeb/DOM/Element.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/Label.h>
#include <LibWeb/Layout/LabelableNode.h> #include <LibWeb/Layout/LabelableNode.h>
#include <LibWeb/Layout/TextNode.h> #include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -9,13 +9,13 @@
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h> #include <LibWeb/Dump.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLHtmlElement.h> #include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/FormattingContext.h> #include <LibWeb/Layout/FormattingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/Node.h> #include <LibWeb/Layout/Node.h>
#include <LibWeb/Layout/TextNode.h> #include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <typeinfo> #include <typeinfo>
namespace Web::Layout { namespace Web::Layout {
@ -91,13 +91,13 @@ HitTestResult Node::hit_test(const Gfx::IntPoint& position, HitTestType type) co
return result; return result;
} }
const BrowsingContext& Node::browsing_context() const HTML::BrowsingContext const& Node::browsing_context() const
{ {
VERIFY(document().browsing_context()); VERIFY(document().browsing_context());
return *document().browsing_context(); return *document().browsing_context();
} }
BrowsingContext& Node::browsing_context() HTML::BrowsingContext& Node::browsing_context()
{ {
VERIFY(document().browsing_context()); VERIFY(document().browsing_context());
return *document().browsing_context(); return *document().browsing_context();

View file

@ -65,8 +65,8 @@ public:
DOM::Document& document() { return m_document; } DOM::Document& document() { return m_document; }
const DOM::Document& document() const { return m_document; } const DOM::Document& document() const { return m_document; }
const BrowsingContext& browsing_context() const; HTML::BrowsingContext const& browsing_context() const;
BrowsingContext& browsing_context(); HTML::BrowsingContext& browsing_context();
const InitialContainingBlock& root() const; const InitialContainingBlock& root() const;
InitialContainingBlock& root(); InitialContainingBlock& root();

View file

@ -8,9 +8,9 @@
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibGfx/StylePainter.h> #include <LibGfx/StylePainter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/Label.h>
#include <LibWeb/Layout/RadioButton.h> #include <LibWeb/Layout/RadioButton.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -5,6 +5,7 @@
*/ */
#include <LibWeb/DOM/Node.h> #include <LibWeb/DOM/Node.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/Box.h> #include <LibWeb/Layout/Box.h>
#include <LibWeb/Layout/InlineFormattingContext.h> #include <LibWeb/Layout/InlineFormattingContext.h>
#include <LibWeb/Layout/TableBox.h> #include <LibWeb/Layout/TableBox.h>
@ -12,7 +13,6 @@
#include <LibWeb/Layout/TableFormattingContext.h> #include <LibWeb/Layout/TableFormattingContext.h>
#include <LibWeb/Layout/TableRowBox.h> #include <LibWeb/Layout/TableRowBox.h>
#include <LibWeb/Layout/TableRowGroupBox.h> #include <LibWeb/Layout/TableRowGroupBox.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -8,11 +8,11 @@
#include <AK/StringBuilder.h> #include <AK/StringBuilder.h>
#include <LibGfx/Painter.h> #include <LibGfx/Painter.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/BlockContainer.h> #include <LibWeb/Layout/BlockContainer.h>
#include <LibWeb/Layout/InlineFormattingContext.h> #include <LibWeb/Layout/InlineFormattingContext.h>
#include <LibWeb/Layout/Label.h> #include <LibWeb/Layout/Label.h>
#include <LibWeb/Layout/TextNode.h> #include <LibWeb/Layout/TextNode.h>
#include <LibWeb/Page/BrowsingContext.h>
namespace Web::Layout { namespace Web::Layout {

View file

@ -13,18 +13,18 @@
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/ElementFactory.h> #include <LibWeb/DOM/ElementFactory.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/HTML/Parser/HTMLParser.h> #include <LibWeb/HTML/Parser/HTMLParser.h>
#include <LibWeb/Loader/FrameLoader.h> #include <LibWeb/Loader/FrameLoader.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
namespace Web { namespace Web {
static RefPtr<Gfx::Bitmap> s_default_favicon_bitmap; static RefPtr<Gfx::Bitmap> s_default_favicon_bitmap;
FrameLoader::FrameLoader(BrowsingContext& browsing_context) FrameLoader::FrameLoader(HTML::BrowsingContext& browsing_context)
: m_browsing_context(browsing_context) : m_browsing_context(browsing_context)
{ {
if (!s_default_favicon_bitmap) { if (!s_default_favicon_bitmap) {

View file

@ -23,7 +23,7 @@ public:
IFrame, IFrame,
}; };
explicit FrameLoader(BrowsingContext&); explicit FrameLoader(HTML::BrowsingContext&);
~FrameLoader(); ~FrameLoader();
bool load(const AK::URL&, Type); bool load(const AK::URL&, Type);
@ -31,8 +31,8 @@ public:
void load_html(StringView, const AK::URL&); void load_html(StringView, const AK::URL&);
BrowsingContext& browsing_context() { return m_browsing_context; } HTML::BrowsingContext& browsing_context() { return m_browsing_context; }
const BrowsingContext& browsing_context() const { return m_browsing_context; } HTML::BrowsingContext const& browsing_context() const { return m_browsing_context; }
private: private:
// ^ResourceClient // ^ResourceClient
@ -43,7 +43,7 @@ private:
void load_favicon(RefPtr<Gfx::Bitmap> bitmap = nullptr); void load_favicon(RefPtr<Gfx::Bitmap> bitmap = nullptr);
bool parse_document(DOM::Document&, const ByteBuffer& data); bool parse_document(DOM::Document&, const ByteBuffer& data);
BrowsingContext& m_browsing_context; HTML::BrowsingContext& m_browsing_context;
size_t m_redirects_count { 0 }; size_t m_redirects_count { 0 };
}; };

View file

@ -10,9 +10,9 @@
#include <LibWeb/DOM/Position.h> #include <LibWeb/DOM/Position.h>
#include <LibWeb/DOM/Range.h> #include <LibWeb/DOM/Range.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Layout/LayoutPosition.h> #include <LibWeb/Layout/LayoutPosition.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/EditEventHandler.h> #include <LibWeb/Page/EditEventHandler.h>
namespace Web { namespace Web {

View file

@ -13,7 +13,7 @@ namespace Web {
class EditEventHandler { class EditEventHandler {
public: public:
explicit EditEventHandler(BrowsingContext& frame) explicit EditEventHandler(HTML::BrowsingContext& frame)
: m_frame(frame) : m_frame(frame)
{ {
} }
@ -25,7 +25,7 @@ public:
virtual void handle_insert(DOM::Position, u32 code_point); virtual void handle_insert(DOM::Position, u32 code_point);
private: private:
BrowsingContext& m_frame; HTML::BrowsingContext& m_frame;
}; };
} }

View file

@ -9,11 +9,11 @@
#include <LibWeb/DOM/Range.h> #include <LibWeb/DOM/Range.h>
#include <LibWeb/DOM/Text.h> #include <LibWeb/DOM/Text.h>
#include <LibWeb/DOM/Window.h> #include <LibWeb/DOM/Window.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/HTML/HTMLAnchorElement.h> #include <LibWeb/HTML/HTMLAnchorElement.h>
#include <LibWeb/HTML/HTMLIFrameElement.h> #include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/HTML/HTMLImageElement.h> #include <LibWeb/HTML/HTMLImageElement.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/Page/EventHandler.h> #include <LibWeb/Page/EventHandler.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
#include <LibWeb/UIEvents/EventNames.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_frame(frame)
, m_edit_event_handler(make<EditEventHandler>(frame)) , m_edit_event_handler(make<EditEventHandler>(frame))
{ {

View file

@ -17,11 +17,9 @@
namespace Web { namespace Web {
class BrowsingContext;
class EventHandler { class EventHandler {
public: public:
explicit EventHandler(Badge<BrowsingContext>, BrowsingContext&); explicit EventHandler(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
~EventHandler(); ~EventHandler();
bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers); bool handle_mouseup(const Gfx::IntPoint&, unsigned button, unsigned modifiers);
@ -43,7 +41,7 @@ private:
Layout::InitialContainingBlock* layout_root(); Layout::InitialContainingBlock* layout_root();
const Layout::InitialContainingBlock* layout_root() const; const Layout::InitialContainingBlock* layout_root() const;
BrowsingContext& m_frame; HTML::BrowsingContext& m_frame;
bool m_in_mouse_selection { false }; bool m_in_mouse_selection { false };

View file

@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibWeb/Page/BrowsingContext.h> #include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Page/Page.h> #include <LibWeb/Page/Page.h>
namespace Web { namespace Web {
@ -12,21 +12,21 @@ namespace Web {
Page::Page(PageClient& client) Page::Page(PageClient& client)
: m_client(client) : m_client(client)
{ {
m_top_level_browsing_context = BrowsingContext::create(*this); m_top_level_browsing_context = HTML::BrowsingContext::create(*this);
} }
Page::~Page() Page::~Page()
{ {
} }
BrowsingContext& Page::focused_context() HTML::BrowsingContext& Page::focused_context()
{ {
if (m_focused_context) if (m_focused_context)
return *m_focused_context; return *m_focused_context;
return top_level_browsing_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(); m_focused_context = browsing_context.make_weak_ptr();
} }

View file

@ -34,13 +34,13 @@ public:
PageClient& client() { return m_client; } PageClient& client() { return m_client; }
const PageClient& client() const { return m_client; } const PageClient& client() const { return m_client; }
Web::BrowsingContext& top_level_browsing_context() { return *m_top_level_browsing_context; } HTML::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 const& top_level_browsing_context() const { return *m_top_level_browsing_context; }
Web::BrowsingContext& focused_context(); HTML::BrowsingContext& focused_context();
const Web::BrowsingContext& focused_context() const { return const_cast<Page*>(this)->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(const AK::URL&);
void load(LoadRequest&); void load(LoadRequest&);
@ -65,8 +65,8 @@ public:
private: private:
PageClient& m_client; PageClient& m_client;
RefPtr<BrowsingContext> m_top_level_browsing_context; RefPtr<HTML::BrowsingContext> m_top_level_browsing_context;
WeakPtr<BrowsingContext> m_focused_context; WeakPtr<HTML::BrowsingContext> m_focused_context;
// FIXME: Enable this by default once CORS preflight checks are supported. // FIXME: Enable this by default once CORS preflight checks are supported.
bool m_same_origin_policy_enabled { false }; bool m_same_origin_policy_enabled { false };

View file

@ -18,10 +18,10 @@
#include <LibWeb/Cookie/ParsedCookie.h> #include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/DOM/Document.h> #include <LibWeb/DOM/Document.h>
#include <LibWeb/Dump.h> #include <LibWeb/Dump.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Loader/ContentFilter.h> #include <LibWeb/Loader/ContentFilter.h>
#include <LibWeb/Loader/ResourceLoader.h> #include <LibWeb/Loader/ResourceLoader.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <WebContent/ClientConnection.h> #include <WebContent/ClientConnection.h>
#include <WebContent/PageHost.h> #include <WebContent/PageHost.h>
#include <WebContent/WebContentClientEndpoint.h> #include <WebContent/WebContentClientEndpoint.h>

View file

@ -10,8 +10,8 @@
#include <LibGfx/ShareableBitmap.h> #include <LibGfx/ShareableBitmap.h>
#include <LibGfx/SystemTheme.h> #include <LibGfx/SystemTheme.h>
#include <LibWeb/Cookie/ParsedCookie.h> #include <LibWeb/Cookie/ParsedCookie.h>
#include <LibWeb/HTML/BrowsingContext.h>
#include <LibWeb/Layout/InitialContainingBlock.h> #include <LibWeb/Layout/InitialContainingBlock.h>
#include <LibWeb/Page/BrowsingContext.h>
#include <WebContent/WebContentClientEndpoint.h> #include <WebContent/WebContentClientEndpoint.h>
namespace WebContent { namespace WebContent {