| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2024, Tim Ledbetter <tim.ledbetter@ladybird.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/Bindings/BeforeUnloadEventPrototype.h>
 | 
					
						
							|  |  |  | #include <LibWeb/Bindings/Intrinsics.h>
 | 
					
						
							| 
									
										
										
										
											2024-11-02 09:22:13 -04:00
										 |  |  | #include <LibWeb/HTML/BeforeUnloadEvent.h>
 | 
					
						
							| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-02 09:22:13 -04:00
										 |  |  | namespace Web::HTML { | 
					
						
							| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  | GC_DEFINE_ALLOCATOR(BeforeUnloadEvent); | 
					
						
							| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  | GC::Ref<BeforeUnloadEvent> BeforeUnloadEvent::create(JS::Realm& realm, FlyString const& event_name, DOM::EventInit const& event_init) | 
					
						
							| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2024-11-14 05:50:17 +13:00
										 |  |  |     return realm.create<BeforeUnloadEvent>(realm, event_name, event_init); | 
					
						
							| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BeforeUnloadEvent::BeforeUnloadEvent(JS::Realm& realm, FlyString const& event_name, DOM::EventInit const& event_init) | 
					
						
							|  |  |  |     : DOM::Event(realm, event_name, event_init) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BeforeUnloadEvent::~BeforeUnloadEvent() = default; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void BeforeUnloadEvent::initialize(JS::Realm& realm) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     WEB_SET_PROTOTYPE_FOR_INTERFACE(BeforeUnloadEvent); | 
					
						
							| 
									
										
										
										
											2025-04-20 16:22:57 +02:00
										 |  |  |     Base::initialize(realm); | 
					
						
							| 
									
										
										
										
											2024-10-02 23:54:48 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |