diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/AbstractRange.h')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/AbstractRange.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/AbstractRange.h b/Userland/Libraries/LibWeb/DOM/AbstractRange.h index 0407de68f2..e0dded6372 100644 --- a/Userland/Libraries/LibWeb/DOM/AbstractRange.h +++ b/Userland/Libraries/LibWeb/DOM/AbstractRange.h @@ -1,23 +1,24 @@ /* * Copyright (c) 2022, Luke Wilde <lukew@serenityos.org> + * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once -#include <AK/RefCounted.h> -#include <LibWeb/Bindings/Wrappable.h> +#include <LibWeb/Bindings/PlatformObject.h> +#include <LibWeb/Forward.h> namespace Web::DOM { -class AbstractRange - : public RefCounted<AbstractRange> - , public Bindings::Wrappable { +class AbstractRange : public Bindings::PlatformObject { + JS_OBJECT(AbstractRange, Bindings::PlatformObject); + public: - using WrapperType = Bindings::AbstractRangeWrapper; + virtual ~AbstractRange() override; - virtual ~AbstractRange() override = default; + AbstractRange& impl() { return *this; } Node* start_container() { return m_start_container; } Node const* start_container() const { return m_start_container; } @@ -35,13 +36,7 @@ public: } protected: - AbstractRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset) - : m_start_container(start_container) - , m_start_offset(start_offset) - , m_end_container(end_container) - , m_end_offset(end_offset) - { - } + AbstractRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset); NonnullRefPtr<Node> m_start_container; u32 m_start_offset; @@ -51,3 +46,8 @@ protected: }; } + +namespace Web::Bindings { +inline JS::Object* wrap(JS::Realm&, Web::DOM::AbstractRange& object) { return &object; } +using AbstractRangeWrapper = Web::DOM::AbstractRange; +} |