summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML/DOMParser.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-08-31 18:39:32 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-06 00:27:09 +0200
commitd5e831988e169b917f27440e1cc74eb15c7af521 (patch)
treee9e0b3cec60a631904eb8166527fd8fbe663d693 /Userland/Libraries/LibWeb/HTML/DOMParser.h
parent8341f142ea31c92170f1edce7a1e3f4146547b7b (diff)
downloadserenity-d5e831988e169b917f27440e1cc74eb15c7af521.zip
LibWeb: Make DOMParser GC-allocated
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/DOMParser.h')
-rw-r--r--Userland/Libraries/LibWeb/HTML/DOMParser.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/DOMParser.h b/Userland/Libraries/LibWeb/HTML/DOMParser.h
index 4c1c50f708..943cbcc0c8 100644
--- a/Userland/Libraries/LibWeb/HTML/DOMParser.h
+++ b/Userland/Libraries/LibWeb/HTML/DOMParser.h
@@ -6,9 +6,7 @@
#pragma once
-#include <AK/RefCounted.h>
-#include <AK/Weakable.h>
-#include <LibWeb/Bindings/Wrappable.h>
+#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/Forward.h>
@@ -16,17 +14,11 @@
namespace Web::HTML {
// https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparser
-class DOMParser final
- : public RefCounted<DOMParser>
- , public Weakable<DOMParser>
- , public Bindings::Wrappable {
-public:
- using WrapperType = Bindings::DOMParserWrapper;
+class DOMParser final : public Bindings::PlatformObject {
+ WEB_PLATFORM_OBJECT(DOMParser, Bindings::PlatformObject);
- static DOM::ExceptionOr<NonnullRefPtr<DOMParser>> create_with_global_object(HTML::Window& window)
- {
- return adopt_ref(*new DOMParser(window));
- }
+public:
+ static DOM::ExceptionOr<JS::NonnullGCPtr<DOMParser>> create_with_global_object(HTML::Window&);
virtual ~DOMParser() override;
@@ -34,8 +26,8 @@ public:
private:
explicit DOMParser(HTML::Window&);
-
- JS::Handle<HTML::Window> m_window;
};
}
+
+WRAPPER_HACK(DOMParser, Web::HTML)