| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2020, the SerenityOS developers. | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  |  * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | #include <LibJS/Heap/GCPtr.h>
 | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  | #include <LibWeb/Bindings/PlatformObject.h>
 | 
					
						
							| 
									
										
										
										
											2021-12-09 12:51:05 +01:00
										 |  |  | #include <LibWeb/DOM/Document.h>
 | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::DOM { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  | class DOMImplementation final : public Bindings::PlatformObject { | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     WEB_PLATFORM_OBJECT(DOMImplementation, Bindings::PlatformObject); | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] static JS::NonnullGCPtr<DOMImplementation> create(Document&); | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  |     virtual ~DOMImplementation(); | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-04 18:02:33 +00:00
										 |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> create_document(DeprecatedString const&, DeprecatedString const&, JS::GCPtr<DocumentType>) const; | 
					
						
							|  |  |  |     JS::NonnullGCPtr<Document> create_html_document(DeprecatedString const& title) const; | 
					
						
							|  |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<DocumentType>> create_document_type(DeprecatedString const& qualified_name, DeprecatedString const& public_id, DeprecatedString const& system_id); | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
 | 
					
						
							| 
									
										
										
										
											2023-08-12 21:30:16 +12:00
										 |  |  |     bool has_feature() const | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         // The hasFeature() method steps are to return true.
 | 
					
						
							|  |  |  |         return true; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     explicit DOMImplementation(Document&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-07 08:41:28 +02:00
										 |  |  |     virtual void initialize(JS::Realm&) override; | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-08 15:52:48 +02:00
										 |  |  |     Document& document() { return m_document; } | 
					
						
							|  |  |  |     Document const& document() const { return m_document; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-26 16:09:02 -07:00
										 |  |  |     JS::NonnullGCPtr<Document> m_document; | 
					
						
							| 
									
										
										
										
											2020-11-13 06:08:06 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |