summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout/Node.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-10 22:38:08 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-11 00:21:49 +0100
commited84fbce474a86721ff85aa9559213e12bd556ba (patch)
treee87ff19b4581c0c5206a0d40831ed392b591c3ba /Userland/Libraries/LibWeb/Layout/Node.h
parent702cee3d7c36570763c5552461b9665f557bf9cc (diff)
downloadserenity-ed84fbce474a86721ff85aa9559213e12bd556ba.zip
LibWeb: Make Paintable ref-counted
This will allow us to use a protective NonnullRefPtr to keep paintables alive while running arbitrary JavaScript in response to events.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/Node.h')
-rw-r--r--Userland/Libraries/LibWeb/Layout/Node.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h
index 5cb405df73..a5d535b203 100644
--- a/Userland/Libraries/LibWeb/Layout/Node.h
+++ b/Userland/Libraries/LibWeb/Layout/Node.h
@@ -54,10 +54,11 @@ public:
const DOM::Node* dom_node() const { return m_dom_node; }
DOM::Node* dom_node() { return m_dom_node; }
+ Painting::Paintable* paintable() { return m_paintable; }
Painting::Paintable const* paintable() const { return m_paintable; }
- void set_paintable(OwnPtr<Painting::Paintable>);
+ void set_paintable(RefPtr<Painting::Paintable>);
- virtual OwnPtr<Painting::Paintable> create_paintable() const;
+ virtual RefPtr<Painting::Paintable> create_paintable() const;
DOM::Document& document() { return m_document; }
const DOM::Document& document() const { return m_document; }
@@ -224,7 +225,7 @@ private:
NonnullRefPtr<DOM::Document> m_document;
RefPtr<DOM::Node> m_dom_node;
- OwnPtr<Painting::Paintable> m_paintable;
+ RefPtr<Painting::Paintable> m_paintable;
bool m_inline { false };
bool m_has_style { false };