mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:22:45 +00:00 
			
		
		
		
	 834202aeb9
			
		
	
	
		834202aeb9
		
	
	
	
	
		
			
			This needs to happen before prototype/constructor intitialization can be made lazy. Otherwise, GC could run during the C++ constructor and try to collect the object currently being created.
		
			
				
	
	
		
			56 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
	
		
			1.5 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/Bindings/Intrinsics.h>
 | |
| #include <LibWeb/DOM/Element.h>
 | |
| #include <LibWeb/IntersectionObserver/IntersectionObserver.h>
 | |
| 
 | |
| namespace Web::IntersectionObserver {
 | |
| 
 | |
| // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-intersectionobserver
 | |
| JS::NonnullGCPtr<IntersectionObserver> IntersectionObserver::construct_impl(JS::Realm& realm, WebIDL::CallbackType* callback, IntersectionObserverInit const& options)
 | |
| {
 | |
|     // FIXME: Implement
 | |
|     (void)callback;
 | |
|     (void)options;
 | |
| 
 | |
|     return realm.heap().allocate<IntersectionObserver>(realm, realm);
 | |
| }
 | |
| 
 | |
| IntersectionObserver::IntersectionObserver(JS::Realm& realm)
 | |
|     : PlatformObject(realm)
 | |
| {
 | |
| }
 | |
| 
 | |
| 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)
 | |
| {
 | |
|     // FIXME: Implement
 | |
|     (void)target;
 | |
| }
 | |
| 
 | |
| // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-unobserve
 | |
| void IntersectionObserver::unobserve(DOM::Element& target)
 | |
| {
 | |
|     // FIXME: Implement
 | |
|     (void)target;
 | |
| }
 | |
| 
 | |
| // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-disconnect
 | |
| void IntersectionObserver::disconnect()
 | |
| {
 | |
|     // FIXME: Implement
 | |
| }
 | |
| 
 | |
| }
 |