| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2020, the SerenityOS developers. | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/DOM/Event.h>
 | 
					
						
							| 
									
										
										
										
											2021-10-01 18:46:37 +03:00
										 |  |  | #include <LibWeb/HTML/HTMLElement.h>
 | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-01 18:46:37 +03:00
										 |  |  | struct SubmitEventInit : public DOM::EventInit { | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     JS::GCPtr<HTMLElement> submitter; | 
					
						
							| 
									
										
										
										
											2021-10-01 18:46:37 +03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | class SubmitEvent final : public DOM::Event { | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     WEB_PLATFORM_OBJECT(SubmitEvent, DOM::Event); | 
					
						
							| 
									
										
										
										
											2023-11-19 19:47:52 +01:00
										 |  |  |     JS_DECLARE_ALLOCATOR(SubmitEvent); | 
					
						
							| 
									
										
										
										
											2022-08-08 22:29:40 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] static JS::NonnullGCPtr<SubmitEvent> create(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); | 
					
						
							| 
									
										
										
										
											2023-03-05 10:58:45 +01:00
										 |  |  |     static WebIDL::ExceptionOr<JS::NonnullGCPtr<SubmitEvent>> construct_impl(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); | 
					
						
							| 
									
										
										
										
											2022-08-08 22:29:40 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     virtual ~SubmitEvent() override; | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     JS::GCPtr<HTMLElement> submitter() const { return m_submitter; } | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2023-03-05 10:58:45 +01:00
										 |  |  |     SubmitEvent(JS::Realm&, FlyString const& event_name, SubmitEventInit const& event_init); | 
					
						
							| 
									
										
										
										
											2022-09-25 16:38:21 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     JS::GCPtr<HTMLElement> m_submitter; | 
					
						
							| 
									
										
										
										
											2020-11-21 21:53:18 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |