diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-04 13:20:53 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-06 00:27:09 +0200 |
commit | 8f2a711132292238ffd1cd4a2d15556914e0d6dd (patch) | |
tree | 6ecef648c3996fe5a9897cf5439189b020325fca /Userland/Libraries/LibWeb/Selection/Selection.h | |
parent | be9d3860b9f962191f658dd991c80edd2ab50a91 (diff) | |
download | serenity-8f2a711132292238ffd1cd4a2d15556914e0d6dd.zip |
LibWeb: Make Selection GC-allocated
Diffstat (limited to 'Userland/Libraries/LibWeb/Selection/Selection.h')
-rw-r--r-- | Userland/Libraries/LibWeb/Selection/Selection.h | 19 |
1 files changed, 11 insertions, 8 deletions
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 <AK/NonnullRefPtr.h> -#include <AK/RefCounted.h> -#include <LibWeb/Bindings/Wrappable.h> +#include <LibWeb/Bindings/PlatformObject.h> namespace Web::Selection { -class Selection - : public RefCounted<Selection> - , public Bindings::Wrappable { +class Selection final : public Bindings::PlatformObject { + WEB_PLATFORM_OBJECT(Selection, Bindings::PlatformObject); + public: - using WrapperType = Bindings::SelectionWrapper; + static JS::NonnullGCPtr<Selection> create(HTML::Window&); - static NonnullRefPtr<Selection> 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) |