mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	 ebe704a03d
			
		
	
	
		ebe704a03d
		
	
	
	
	
		
			
			Note there are a couple of type differences between the spec and the IDL file added in this commit. For example, we will need to support a type of Variant to handle spec types such as "(double or sequence<double>)". But for now, this allows web pages to construct an IntersectionObserver with any valid type.
		
			
				
	
	
		
			43 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #include <LibWeb/DOM/Element.h>
 | |
| #include <LibWeb/IntersectionObserver/IntersectionObserver.h>
 | |
| 
 | |
| namespace Web::IntersectionObserver {
 | |
| 
 | |
| // https://w3c.github.io/IntersectionObserver/#dom-intersectionobserver-intersectionobserver
 | |
| NonnullRefPtr<IntersectionObserver> IntersectionObserver::create_with_global_object(JS::GlobalObject& global_object, JS::Value callback, IntersectionObserverInit const& options)
 | |
| {
 | |
|     // FIXME: Implement
 | |
|     (void)global_object;
 | |
|     (void)callback;
 | |
|     (void)options;
 | |
| 
 | |
|     return adopt_ref(*new 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
 | |
| }
 | |
| 
 | |
| }
 |