summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/StaticRange.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/StaticRange.h')
-rw-r--r--Userland/Libraries/LibWeb/DOM/StaticRange.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/StaticRange.h b/Userland/Libraries/LibWeb/DOM/StaticRange.h
index 69dfaef249..7f44aefb27 100644
--- a/Userland/Libraries/LibWeb/DOM/StaticRange.h
+++ b/Userland/Libraries/LibWeb/DOM/StaticRange.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
+ * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -20,15 +21,20 @@ struct StaticRangeInit {
};
class StaticRange final : public AbstractRange {
-public:
- using WrapperType = Bindings::StaticRangeWrapper;
-
- virtual ~StaticRange() override = default;
+ JS_OBJECT(StaticRange, JS::Object);
- static ExceptionOr<NonnullRefPtr<StaticRange>> create_with_global_object(JS::GlobalObject&, StaticRangeInit& init);
+public:
+ static ExceptionOr<StaticRange*> create_with_global_object(Bindings::WindowObject&, StaticRangeInit& init);
-private:
StaticRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset);
+ virtual ~StaticRange() override;
+
+ StaticRange& impl() { return *this; }
};
}
+
+namespace Web::Bindings {
+inline JS::Object* wrap(JS::Realm&, Web::DOM::StaticRange& object) { return &object; }
+using StaticRangeWrapper = Web::DOM::StaticRange;
+}