summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Selection/Selection.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-04 13:20:53 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-06 00:27:09 +0200
commit8f2a711132292238ffd1cd4a2d15556914e0d6dd (patch)
tree6ecef648c3996fe5a9897cf5439189b020325fca /Userland/Libraries/LibWeb/Selection/Selection.h
parentbe9d3860b9f962191f658dd991c80edd2ab50a91 (diff)
downloadserenity-8f2a711132292238ffd1cd4a2d15556914e0d6dd.zip
LibWeb: Make Selection GC-allocated
Diffstat (limited to 'Userland/Libraries/LibWeb/Selection/Selection.h')
-rw-r--r--Userland/Libraries/LibWeb/Selection/Selection.h19
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)