From 5559a3dc6e55254f792b5be573aecd468fce7e08 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 13 Oct 2024 20:40:43 +0200 Subject: [PATCH] LibWeb: Remove BrowsingContext pointer from Paintable It's no longer needed. --- .../Libraries/LibWeb/Painting/MediaPaintable.cpp | 4 ++-- Userland/Libraries/LibWeb/Painting/Paintable.cpp | 12 ------------ Userland/Libraries/LibWeb/Painting/Paintable.h | 4 ---- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/Userland/Libraries/LibWeb/Painting/MediaPaintable.cpp b/Userland/Libraries/LibWeb/Painting/MediaPaintable.cpp index dc4a74d6b82..7c3f721793d 100644 --- a/Userland/Libraries/LibWeb/Painting/MediaPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/MediaPaintable.cpp @@ -308,7 +308,7 @@ MediaPaintable::DispatchEventOfSameName MediaPaintable::handle_mouseup(Badge(media_element.volume() * 100.0); - browsing_context().page().client().page_did_request_tooltip_override({ position_adjusted_by_scroll_offset.x(), cached_layout_boxes.volume_scrub_rect->y() + scroll_offset.y() }, ByteString::formatted("{}%", volume)); + document().page().client().page_did_request_tooltip_override({ position_adjusted_by_scroll_offset.x(), cached_layout_boxes.volume_scrub_rect->y() + scroll_offset.y() }, ByteString::formatted("{}%", volume)); } break; diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.cpp b/Userland/Libraries/LibWeb/Painting/Paintable.cpp index 613306b8596..8e792403f01 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/Paintable.cpp @@ -14,7 +14,6 @@ namespace Web::Painting { Paintable::Paintable(Layout::Node const& layout_node) : m_layout_node(layout_node) - , m_browsing_context(const_cast(layout_node.browsing_context())) { auto& computed_values = layout_node.computed_values(); if (layout_node.is_grid_item() && computed_values.z_index().has_value()) { @@ -42,7 +41,6 @@ void Paintable::visit_edges(Cell::Visitor& visitor) TreeNode::visit_edges(visitor); visitor.visit(m_dom_node); visitor.visit(m_layout_node); - visitor.visit(m_browsing_context); if (m_containing_block.has_value()) visitor.visit(m_containing_block.value()); } @@ -68,16 +66,6 @@ JS::GCPtr Paintable::dom_node() const return m_dom_node; } -HTML::BrowsingContext const& Paintable::browsing_context() const -{ - return m_browsing_context; -} - -HTML::BrowsingContext& Paintable::browsing_context() -{ - return m_browsing_context; -} - JS::GCPtr Paintable::navigable() const { return document().navigable(); diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h index 2519cb0a681..74a582675e3 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.h +++ b/Userland/Libraries/LibWeb/Painting/Paintable.h @@ -198,9 +198,6 @@ public: bool visible_for_hit_testing() const { return computed_values().pointer_events() != CSS::PointerEvents::None; } - [[nodiscard]] HTML::BrowsingContext const& browsing_context() const; - [[nodiscard]] HTML::BrowsingContext& browsing_context(); - JS::GCPtr navigable() const; virtual void set_needs_display(InvalidateDisplayList = InvalidateDisplayList::Yes); @@ -255,7 +252,6 @@ protected: private: JS::GCPtr m_dom_node; JS::NonnullGCPtr m_layout_node; - JS::NonnullGCPtr m_browsing_context; Optional> mutable m_containing_block; OwnPtr m_stacking_context;