From 8f2a711132292238ffd1cd4a2d15556914e0d6dd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 4 Sep 2022 13:20:53 +0200 Subject: LibWeb: Make Selection GC-allocated --- Userland/Libraries/LibWeb/Selection/Selection.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Userland/Libraries/LibWeb/Selection/Selection.h') diff --git a/Userland/Libraries/LibWeb/Selection/Selection.h b/Userland/Libraries/LibWeb/Selection/Selection.h index 65fff1443b..15108587b1 100644 --- a/Userland/Libraries/LibWeb/Selection/Selection.h +++ b/Userland/Libraries/LibWeb/Selection/Selection.h @@ -6,19 +6,17 @@ #pragma once -#include -#include -#include +#include namespace Web::Selection { -class Selection - : public RefCounted - , public Bindings::Wrappable { +class Selection final : public Bindings::PlatformObject { + WEB_PLATFORM_OBJECT(Selection, Bindings::PlatformObject); + public: - using WrapperType = Bindings::SelectionWrapper; + static JS::NonnullGCPtr create(HTML::Window&); - static NonnullRefPtr create(); + virtual ~Selection() override; DOM::Node* anchor_node(); unsigned anchor_offset(); @@ -43,6 +41,11 @@ public: bool contains_node(DOM::Node&, bool allow_partial_containment) const; String to_string() const; + +private: + explicit Selection(HTML::Window&); }; } + +WRAPPER_HACK(Selection, Web::Selection) -- cgit v1.2.3