mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:57:35 +00:00
LibWeb: Give Paintable its own pointer to the corresponding DOM node
Instead of going through the layout node's DOM pointer.
This commit is contained in:
parent
216bd513fa
commit
e67ac16862
3 changed files with 21 additions and 2 deletions
|
@ -131,8 +131,9 @@ public:
|
|||
Layout::Node const& layout_node() const { return m_layout_node; }
|
||||
Layout::Node& layout_node() { return const_cast<Layout::Node&>(*m_layout_node); }
|
||||
|
||||
DOM::Node* dom_node() { return layout_node().dom_node(); }
|
||||
DOM::Node const* dom_node() const { return layout_node().dom_node(); }
|
||||
[[nodiscard]] JS::GCPtr<DOM::Node> dom_node();
|
||||
[[nodiscard]] JS::GCPtr<DOM::Node const> dom_node() const;
|
||||
void set_dom_node(JS::GCPtr<DOM::Node>);
|
||||
|
||||
auto const& computed_values() const { return m_layout_node->computed_values(); }
|
||||
|
||||
|
@ -164,6 +165,7 @@ protected:
|
|||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
JS::GCPtr<DOM::Node> m_dom_node;
|
||||
JS::NonnullGCPtr<Layout::Node const> m_layout_node;
|
||||
Optional<JS::GCPtr<Layout::Box const>> mutable m_containing_block;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue