diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/IntersectionObserver')
-rw-r--r-- | Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp | 7 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp index ec4522deeb..e14bf17609 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.cpp @@ -23,11 +23,16 @@ JS::NonnullGCPtr<IntersectionObserver> IntersectionObserver::construct_impl(JS:: IntersectionObserver::IntersectionObserver(JS::Realm& realm) : PlatformObject(realm) { - set_prototype(&Bindings::cached_web_prototype(realm, "IntersectionObserver")); } IntersectionObserver::~IntersectionObserver() = default; +void IntersectionObserver::initialize(JS::Realm& realm) +{ + Base::initialize(realm); + set_prototype(&Bindings::ensure_web_prototype<Bindings::IntersectionObserverPrototype>(realm, "IntersectionObserver")); +} + // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-observe void IntersectionObserver::observe(DOM::Element& target) { diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h index 82b73a443f..326385ed1e 100644 --- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h +++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h @@ -32,6 +32,8 @@ public: private: explicit IntersectionObserver(JS::Realm&); + + virtual void initialize(JS::Realm&) override; }; } |