From 4190fd219930a6c8b631c396ccafe5190f821414 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 30 May 2021 12:36:53 +0200 Subject: [PATCH] LibWeb: Rename Web::Frame to Web::BrowsingContext Our "frame" concept very closely matches what the web specs call a "browsing context", so let's rename it to that. :^) The "main frame" becomes the "top-level browsing context", and "sub-frames" are now "nested browsing contexts". --- Userland/Applications/Browser/Tab.cpp | 2 +- .../LibWeb/Bindings/WindowObject.cpp | 22 +++--- Userland/Libraries/LibWeb/CMakeLists.txt | 2 +- Userland/Libraries/LibWeb/CSS/Length.cpp | 10 +-- Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 6 +- Userland/Libraries/LibWeb/DOM/Document.cpp | 22 +++--- Userland/Libraries/LibWeb/DOM/Document.h | 10 +-- Userland/Libraries/LibWeb/DOM/Window.cpp | 6 +- Userland/Libraries/LibWeb/Forward.h | 2 +- .../LibWeb/HTML/FrameHostElement.cpp | 18 ++--- .../Libraries/LibWeb/HTML/FrameHostElement.h | 8 +- .../Libraries/LibWeb/HTML/HTMLFormElement.cpp | 2 +- .../LibWeb/HTML/HTMLIFrameElement.cpp | 6 +- .../LibWeb/HTML/HTMLInputElement.cpp | 2 +- .../LibWeb/HTML/HTMLTitleElement.cpp | 2 +- .../Libraries/LibWeb/InProcessWebView.cpp | 30 ++++---- Userland/Libraries/LibWeb/InProcessWebView.h | 2 +- .../LibWeb/Layout/BlockFormattingContext.cpp | 4 +- Userland/Libraries/LibWeb/Layout/Box.cpp | 4 +- .../Libraries/LibWeb/Layout/ButtonBox.cpp | 8 +- Userland/Libraries/LibWeb/Layout/CheckBox.cpp | 6 +- Userland/Libraries/LibWeb/Layout/FrameBox.cpp | 12 +-- Userland/Libraries/LibWeb/Layout/ImageBox.cpp | 6 +- Userland/Libraries/LibWeb/Layout/ImageBox.h | 4 +- .../Layout/InitialContainingBlockBox.cpp | 2 +- Userland/Libraries/LibWeb/Layout/Label.cpp | 2 +- Userland/Libraries/LibWeb/Layout/Node.cpp | 16 ++-- Userland/Libraries/LibWeb/Layout/Node.h | 4 +- .../Libraries/LibWeb/Layout/RadioButton.cpp | 6 +- .../LibWeb/Layout/TableFormattingContext.cpp | 2 +- Userland/Libraries/LibWeb/Layout/TextNode.cpp | 16 ++-- .../Libraries/LibWeb/Loader/FrameLoader.cpp | 28 +++---- .../Libraries/LibWeb/Loader/FrameLoader.h | 8 +- .../Page/{Frame.cpp => BrowsingContext.cpp} | 74 +++++++++---------- .../Page/{Frame.h => BrowsingContext.h} | 26 +++---- .../LibWeb/Page/EditEventHandler.cpp | 2 +- .../Libraries/LibWeb/Page/EditEventHandler.h | 4 +- .../Libraries/LibWeb/Page/EventHandler.cpp | 22 +++--- Userland/Libraries/LibWeb/Page/EventHandler.h | 6 +- Userland/Libraries/LibWeb/Page/Page.cpp | 32 ++++---- Userland/Libraries/LibWeb/Page/Page.h | 16 ++-- .../Services/WebContent/ClientConnection.cpp | 14 ++-- Userland/Services/WebContent/PageHost.cpp | 6 +- 43 files changed, 241 insertions(+), 241 deletions(-) rename Userland/Libraries/LibWeb/Page/{Frame.cpp => BrowsingContext.cpp} (77%) rename Userland/Libraries/LibWeb/Page/{Frame.h => BrowsingContext.h} (74%) diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp index 3a47c87aa6..dd61bd7d6b 100644 --- a/Userland/Applications/Browser/Tab.cpp +++ b/Userland/Applications/Browser/Tab.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include namespace Browser { diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp index 13d28f3591..4d85f0a6b6 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -344,10 +344,10 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::top_getter) auto* impl = impl_from(vm, global_object); if (!impl) return {}; - auto* this_frame = impl->document().frame(); - VERIFY(this_frame); - VERIFY(this_frame->main_frame().document()); - auto& top_window = this_frame->main_frame().document()->window(); + auto* this_browsing_context = impl->document().browsing_context(); + VERIFY(this_browsing_context); + VERIFY(this_browsing_context->top_level_browsing_context().document()); + auto& top_window = this_browsing_context->top_level_browsing_context().document()->window(); return top_window.wrapper(); } @@ -356,14 +356,14 @@ JS_DEFINE_NATIVE_GETTER(WindowObject::parent_getter) auto* impl = impl_from(vm, global_object); if (!impl) return {}; - auto* this_frame = impl->document().frame(); - VERIFY(this_frame); - if (this_frame->parent()) { - VERIFY(this_frame->parent()->document()); - auto& parent_window = this_frame->parent()->document()->window(); + auto* this_browsing_context = impl->document().browsing_context(); + VERIFY(this_browsing_context); + if (this_browsing_context->parent()) { + VERIFY(this_browsing_context->parent()->document()); + auto& parent_window = this_browsing_context->parent()->document()->window(); return parent_window.wrapper(); } - VERIFY(this_frame == &this_frame->main_frame()); + VERIFY(this_browsing_context == &this_browsing_context->top_level_browsing_context()); return impl->wrapper(); } diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index bc9123ed83..4649f46f0c 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -205,9 +205,9 @@ set(SOURCES Namespace.cpp NavigationTiming/PerformanceTiming.cpp OutOfProcessWebView.cpp + Page/BrowsingContext.cpp Page/EditEventHandler.cpp Page/EventHandler.cpp - Page/Frame.cpp Page/Page.cpp Painting/BorderPainting.cpp Painting/StackingContext.cpp diff --git a/Userland/Libraries/LibWeb/CSS/Length.cpp b/Userland/Libraries/LibWeb/CSS/Length.cpp index 18558e126d..6d19c06aee 100644 --- a/Userland/Libraries/LibWeb/CSS/Length.cpp +++ b/Userland/Libraries/LibWeb/CSS/Length.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include namespace Web::CSS { @@ -21,16 +21,16 @@ float Length::relative_length_to_px(const Layout::Node& layout_node) const case Type::Rem: return m_value * layout_node.document().document_element()->layout_node()->font_size(); case Type::Vw: - return layout_node.document().frame()->viewport_rect().width() * (m_value / 100); + return layout_node.document().browsing_context()->viewport_rect().width() * (m_value / 100); case Type::Vh: - return layout_node.document().frame()->viewport_rect().height() * (m_value / 100); + return layout_node.document().browsing_context()->viewport_rect().height() * (m_value / 100); case Type::Vmin: { - auto viewport = layout_node.document().frame()->viewport_rect(); + auto viewport = layout_node.document().browsing_context()->viewport_rect(); return min(viewport.width(), viewport.height()) * (m_value / 100); } case Type::Vmax: { - auto viewport = layout_node.document().frame()->viewport_rect(); + auto viewport = layout_node.document().browsing_context()->viewport_rect(); return max(viewport.width(), viewport.height()) * (m_value / 100); } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index 96ee5c5304..7d85f56227 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace Web::CSS { @@ -165,8 +165,8 @@ void ImageStyleValue::resource_did_load() return; m_bitmap = resource()->bitmap(); // FIXME: Do less than a full repaint if possible? - if (m_document->frame()) - m_document->frame()->set_needs_display({}); + if (m_document->browsing_context()) + m_document->browsing_context()->set_needs_display({}); } } diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 5307657753..b9887a8553 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include #include #include @@ -281,22 +281,22 @@ void Document::set_title(const String& title) title_element->append_child(adopt_ref(*new Text(*this, title))); if (auto* page = this->page()) { - if (frame() == &page->main_frame()) + if (browsing_context() == &page->top_level_browsing_context()) page->client().page_did_change_title(title); } } -void Document::attach_to_frame(Badge, Frame& frame) +void Document::attach_to_browsing_context(Badge, BrowsingContext& browsing_context) { - m_frame = frame; + m_browsing_context = browsing_context; update_layout(); } -void Document::detach_from_frame(Badge, Frame& frame) +void Document::detach_from_browsing_context(Badge, BrowsingContext& browsing_context) { - VERIFY(&frame == m_frame); + VERIFY(&browsing_context == m_browsing_context); tear_down_layout_tree(); - m_frame = nullptr; + m_browsing_context = nullptr; } void Document::tear_down_layout_tree() @@ -399,7 +399,7 @@ void Document::force_layout() void Document::update_layout() { - if (!frame()) + if (!browsing_context()) return; if (!m_layout_root) { @@ -412,7 +412,7 @@ void Document::update_layout() m_layout_root->set_needs_display(); - if (frame()->is_main_frame()) { + if (browsing_context()->is_top_level()) { if (auto* page = this->page()) page->client().page_did_layout(); } @@ -881,12 +881,12 @@ void Document::set_ready_state(const String& ready_state) Page* Document::page() { - return m_frame ? m_frame->page() : nullptr; + return m_browsing_context ? m_browsing_context->page() : nullptr; } const Page* Document::page() const { - return m_frame ? m_frame->page() : nullptr; + return m_browsing_context ? m_browsing_context->page() : nullptr; } EventTarget* Document::get_parent(const Event& event) diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 98b73fe919..d9934f3421 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -115,11 +115,11 @@ public: String title() const; void set_title(const String&); - void attach_to_frame(Badge, Frame&); - void detach_from_frame(Badge, Frame&); + void attach_to_browsing_context(Badge, BrowsingContext&); + void detach_from_browsing_context(Badge, BrowsingContext&); - Frame* frame() { return m_frame.ptr(); } - const Frame* frame() const { return m_frame.ptr(); } + BrowsingContext* browsing_context() { return m_browsing_context.ptr(); } + const BrowsingContext* browsing_context() const { return m_browsing_context.ptr(); } Page* page(); const Page* page() const; @@ -297,7 +297,7 @@ private: RefPtr m_style_sheets; RefPtr m_hovered_node; RefPtr m_inspected_node; - WeakPtr m_frame; + WeakPtr m_browsing_context; URL m_url; RefPtr m_window; diff --git a/Userland/Libraries/LibWeb/DOM/Window.cpp b/Userland/Libraries/LibWeb/DOM/Window.cpp index a5fc6fe89b..24ff88fc88 100644 --- a/Userland/Libraries/LibWeb/DOM/Window.cpp +++ b/Userland/Libraries/LibWeb/DOM/Window.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include namespace Web::DOM { @@ -139,7 +139,7 @@ void Window::cancel_animation_frame(i32 id) void Window::did_set_location_href(Badge, const URL& new_href) { - auto* frame = document().frame(); + auto* frame = document().browsing_context(); if (!frame) return; frame->loader().load(new_href, FrameLoader::Type::Navigation); @@ -147,7 +147,7 @@ void Window::did_set_location_href(Badge, const URL& n void Window::did_call_location_reload(Badge) { - auto* frame = document().frame(); + auto* frame = document().browsing_context(); if (!frame) return; frame->loader().load(document().url(), FrameLoader::Type::Reload); diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index 3098f02da7..186e0d2b17 100644 --- a/Userland/Libraries/LibWeb/Forward.h +++ b/Userland/Libraries/LibWeb/Forward.h @@ -179,7 +179,7 @@ class TextNode; namespace Web { class EventHandler; class EditEventHandler; -class Frame; +class BrowsingContext; class FrameLoader; class InProcessWebView; class LoadRequest; diff --git a/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp b/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp index 30b338a8d3..66a4467205 100644 --- a/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include namespace Web::HTML { @@ -26,18 +26,18 @@ void FrameHostElement::inserted() HTMLElement::inserted(); if (!is_connected()) return; - if (auto* frame = document().frame()) { - m_content_frame = Frame::create_subframe(*this, frame->main_frame()); - m_content_frame->set_frame_nesting_levels(frame->frame_nesting_levels()); - m_content_frame->register_frame_nesting(document().url()); + if (auto* frame = document().browsing_context()) { + m_nested_browsing_context = BrowsingContext::create_nested(*this, frame->top_level_browsing_context()); + m_nested_browsing_context->set_frame_nesting_levels(frame->frame_nesting_levels()); + m_nested_browsing_context->register_frame_nesting(document().url()); } } Origin FrameHostElement::content_origin() const { - if (!m_content_frame || !m_content_frame->document()) + if (!m_nested_browsing_context || !m_nested_browsing_context->document()) return {}; - return m_content_frame->document()->origin(); + return m_nested_browsing_context->document()->origin(); } bool FrameHostElement::may_access_from_origin(const Origin& origin) const @@ -47,10 +47,10 @@ bool FrameHostElement::may_access_from_origin(const Origin& origin) const const DOM::Document* FrameHostElement::content_document() const { - return m_content_frame ? m_content_frame->document() : nullptr; + return m_nested_browsing_context ? m_nested_browsing_context->document() : nullptr; } -void FrameHostElement::content_frame_did_load(Badge) +void FrameHostElement::nested_browsing_context_did_load(Badge) { dispatch_event(DOM::Event::create(EventNames::load)); } diff --git a/Userland/Libraries/LibWeb/HTML/FrameHostElement.h b/Userland/Libraries/LibWeb/HTML/FrameHostElement.h index 54891becd4..6bb7afaefe 100644 --- a/Userland/Libraries/LibWeb/HTML/FrameHostElement.h +++ b/Userland/Libraries/LibWeb/HTML/FrameHostElement.h @@ -15,20 +15,20 @@ public: FrameHostElement(DOM::Document&, QualifiedName); virtual ~FrameHostElement() override; - Frame* content_frame() { return m_content_frame; } - const Frame* content_frame() const { return m_content_frame; } + BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; } + const BrowsingContext* nested_browsing_context() const { return m_nested_browsing_context; } const DOM::Document* content_document() const; Origin content_origin() const; bool may_access_from_origin(const Origin&) const; - void content_frame_did_load(Badge); + void nested_browsing_context_did_load(Badge); virtual void inserted() override; protected: - RefPtr m_content_frame; + RefPtr m_nested_browsing_context; }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp index cfba5f8d4f..53c5c45137 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 736a446457..ba01d28f43 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include namespace Web::HTML { @@ -43,7 +43,7 @@ void HTMLIFrameElement::inserted() void HTMLIFrameElement::load_src(const String& value) { - if (!m_content_frame) + if (!m_nested_browsing_context) return; if (value.is_null()) @@ -60,7 +60,7 @@ void HTMLIFrameElement::load_src(const String& value) } dbgln("Loading iframe document from {}", value); - m_content_frame->loader().load(url, FrameLoader::Type::IFrame); + m_nested_browsing_context->loader().load(url, FrameLoader::Type::IFrame); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 27fcc3e7bd..480f90f3a0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp index c2efc192db..b87e715b27 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp @@ -23,7 +23,7 @@ void HTMLTitleElement::children_changed() { HTMLElement::children_changed(); if (auto* page = document().page()) { - if (document().frame() == &page->main_frame()) + if (document().browsing_context() == &page->top_level_browsing_context()) page->client().page_did_change_title(document().title()); } } diff --git a/Userland/Libraries/LibWeb/InProcessWebView.cpp b/Userland/Libraries/LibWeb/InProcessWebView.cpp index 5417658e6c..f7447e483f 100644 --- a/Userland/Libraries/LibWeb/InProcessWebView.cpp +++ b/Userland/Libraries/LibWeb/InProcessWebView.cpp @@ -23,8 +23,8 @@ #include #include #include +#include #include -#include #include #include @@ -89,7 +89,7 @@ void InProcessWebView::select_all() String InProcessWebView::selected_text() const { - return page().focused_frame().selected_text(); + return page().focused_context().selected_text(); } void InProcessWebView::page_did_layout() @@ -104,7 +104,7 @@ void InProcessWebView::page_did_change_title(const String& title) on_title_change(title); } -void InProcessWebView::page_did_set_document_in_main_frame(DOM::Document* document) +void InProcessWebView::page_did_set_document_in_top_level_browsing_context(DOM::Document* document) { if (on_set_document) on_set_document(document); @@ -210,17 +210,17 @@ void InProcessWebView::layout_and_sync_size() bool had_vertical_scrollbar = vertical_scrollbar().is_visible(); bool had_horizontal_scrollbar = horizontal_scrollbar().is_visible(); - page().main_frame().set_size(available_size()); + page().top_level_browsing_context().set_size(available_size()); set_content_size(layout_root()->size().to_type()); // NOTE: If layout caused us to gain or lose scrollbars, we have to lay out again // since the scrollbars now take up some of the available space. if (had_vertical_scrollbar != vertical_scrollbar().is_visible() || had_horizontal_scrollbar != horizontal_scrollbar().is_visible()) { - page().main_frame().set_size(available_size()); + page().top_level_browsing_context().set_size(available_size()); set_content_size(layout_root()->size().to_type()); } - page().main_frame().set_viewport_scroll_offset({ horizontal_scrollbar().value(), vertical_scrollbar().value() }); + page().top_level_browsing_context().set_viewport_scroll_offset({ horizontal_scrollbar().value(), vertical_scrollbar().value() }); } void InProcessWebView::resize_event(GUI::ResizeEvent& event) @@ -319,9 +319,9 @@ void InProcessWebView::keydown_event(GUI::KeyEvent& event) URL InProcessWebView::url() const { - if (!page().main_frame().document()) + if (!page().top_level_browsing_context().document()) return {}; - return page().main_frame().document()->url(); + return page().top_level_browsing_context().document()->url(); } void InProcessWebView::reload() @@ -331,13 +331,13 @@ void InProcessWebView::reload() void InProcessWebView::load_html(const StringView& html, const URL& url) { - page().main_frame().loader().load_html(html, url); + page().top_level_browsing_context().loader().load_html(html, url); } bool InProcessWebView::load(const URL& url) { set_override_cursor(Gfx::StandardCursor::None); - return page().main_frame().loader().load(url, FrameLoader::Type::Navigation); + return page().top_level_browsing_context().loader().load(url, FrameLoader::Type::Navigation); } const Layout::InitialContainingBlockBox* InProcessWebView::layout_root() const @@ -360,27 +360,27 @@ void InProcessWebView::page_did_request_scroll_into_view(const Gfx::IntRect& rec void InProcessWebView::load_empty_document() { - page().main_frame().set_document(nullptr); + page().top_level_browsing_context().set_document(nullptr); } DOM::Document* InProcessWebView::document() { - return page().main_frame().document(); + return page().top_level_browsing_context().document(); } const DOM::Document* InProcessWebView::document() const { - return page().main_frame().document(); + return page().top_level_browsing_context().document(); } void InProcessWebView::set_document(DOM::Document* document) { - page().main_frame().set_document(document); + page().top_level_browsing_context().set_document(document); } void InProcessWebView::did_scroll() { - page().main_frame().set_viewport_scroll_offset({ horizontal_scrollbar().value(), vertical_scrollbar().value() }); + page().top_level_browsing_context().set_viewport_scroll_offset({ horizontal_scrollbar().value(), vertical_scrollbar().value() }); } void InProcessWebView::drop_event(GUI::DropEvent& event) diff --git a/Userland/Libraries/LibWeb/InProcessWebView.h b/Userland/Libraries/LibWeb/InProcessWebView.h index 12c5e58864..beb779c19a 100644 --- a/Userland/Libraries/LibWeb/InProcessWebView.h +++ b/Userland/Libraries/LibWeb/InProcessWebView.h @@ -70,7 +70,7 @@ private: virtual Gfx::Palette palette() const override { return GUI::AbstractScrollableWidget::palette(); } virtual Gfx::IntRect screen_rect() const override { return GUI::Desktop::the().rect(); } virtual void page_did_change_title(const String&) override; - virtual void page_did_set_document_in_main_frame(DOM::Document*) override; + virtual void page_did_set_document_in_top_level_browsing_context(DOM::Document*) override; virtual void page_did_start_loading(const URL&) override; virtual void page_did_finish_loading(const URL&) override; virtual void page_did_change_selection() override; diff --git a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp index b0650284ef..f7a21b01b4 100644 --- a/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/BlockFormattingContext.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include namespace Web::Layout { @@ -516,7 +516,7 @@ void BlockFormattingContext::place_block_level_non_replaced_element_in_normal_fl void BlockFormattingContext::layout_initial_containing_block(LayoutMode layout_mode) { - auto viewport_rect = context_box().frame().viewport_rect(); + auto viewport_rect = context_box().browsing_context().viewport_rect(); auto& icb = downcast(context_box()); icb.build_stacking_context_tree(); diff --git a/Userland/Libraries/LibWeb/Layout/Box.cpp b/Userland/Libraries/LibWeb/Layout/Box.cpp index de85dde8c5..398ffb4909 100644 --- a/Userland/Libraries/LibWeb/Layout/Box.cpp +++ b/Userland/Libraries/LibWeb/Layout/Box.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include namespace Web::Layout { @@ -293,7 +293,7 @@ HitTestResult Box::hit_test(const Gfx::IntPoint& position, HitTestType type) con void Box::set_needs_display() { if (!is_inline()) { - frame().set_needs_display(enclosing_int_rect(absolute_rect())); + browsing_context().set_needs_display(enclosing_int_rect(absolute_rect())); return; } diff --git a/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp b/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp index 614f4bcada..0679257e55 100644 --- a/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include namespace Web::Layout { @@ -63,7 +63,7 @@ void ButtonBox::handle_mousedown(Badge, const Gfx::IntPoint&, unsi set_needs_display(); m_tracking_mouse = true; - frame().event_handler().set_mouse_event_tracking_layout_node(this); + browsing_context().event_handler().set_mouse_event_tracking_layout_node(this); } void ButtonBox::handle_mouseup(Badge, const Gfx::IntPoint& position, unsigned button, unsigned) @@ -73,7 +73,7 @@ void ButtonBox::handle_mouseup(Badge, const Gfx::IntPoint& positio // NOTE: Handling the click may run arbitrary JS, which could disappear this node. NonnullRefPtr protected_this = *this; - NonnullRefPtr protected_frame = frame(); + NonnullRefPtr protected_frame = browsing_context(); bool is_inside_node_or_label = enclosing_int_rect(absolute_rect()).contains(position); if (!is_inside_node_or_label) @@ -114,7 +114,7 @@ void ButtonBox::handle_associated_label_mouseup(Badge