1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 10:47:35 +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

@ -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();

View file

@ -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;

View file

@ -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 {

View file

@ -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>