| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/HTMLElement.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-12 12:20:02 +01:00
										 |  |  | class NavigableContainer : public HTMLElement { | 
					
						
							|  |  |  |     WEB_PLATFORM_OBJECT(NavigableContainer, HTMLElement); | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2022-12-12 12:20:02 +01:00
										 |  |  |     virtual ~NavigableContainer() override; | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-12-12 12:20:02 +01:00
										 |  |  |     static HashTable<NavigableContainer*>& all_instances(); | 
					
						
							| 
									
										
										
										
											2022-09-19 20:50:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-30 12:36:53 +02:00
										 |  |  |     BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; } | 
					
						
							| 
									
										
										
										
											2022-04-01 20:58:27 +03:00
										 |  |  |     BrowsingContext const* nested_browsing_context() const { return m_nested_browsing_context; } | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     const DOM::Document* content_document() const; | 
					
						
							| 
									
										
										
										
											2022-02-16 22:51:25 +00:00
										 |  |  |     DOM::Document const* content_document_without_origin_check() const; | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-04 10:05:10 +01:00
										 |  |  |     HTML::WindowProxy* content_window(); | 
					
						
							| 
									
										
										
										
											2022-08-04 20:13:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-24 22:08:06 +02:00
										 |  |  |     DOM::Document const* get_svg_document() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | protected: | 
					
						
							| 
									
										
										
										
											2022-12-12 12:20:02 +01:00
										 |  |  |     NavigableContainer(DOM::Document&, DOM::QualifiedName); | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-17 11:06:50 +02:00
										 |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-19 13:34:36 +02:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#shared-attribute-processing-steps-for-iframe-and-frame-elements
 | 
					
						
							|  |  |  |     void shared_attribute_processing_steps_for_iframe_and_frame(bool initial_insertion); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#navigate-an-iframe-or-frame
 | 
					
						
							| 
									
										
										
										
											2022-10-30 01:52:07 +00:00
										 |  |  |     void navigate_an_iframe_or_frame(JS::NonnullGCPtr<Fetch::Infrastructure::Request>); | 
					
						
							| 
									
										
										
										
											2022-09-19 13:34:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-23 20:13:34 -04:00
										 |  |  |     void create_new_nested_browsing_context(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-17 11:06:50 +02:00
										 |  |  |     JS::GCPtr<BrowsingContext> m_nested_browsing_context; | 
					
						
							| 
									
										
										
										
											2021-11-24 19:15:04 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-12-12 12:20:02 +01:00
										 |  |  |     virtual bool is_navigable_container() const override { return true; } | 
					
						
							| 
									
										
										
										
											2021-04-03 11:43:08 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-11-24 19:15:04 +03:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Web::DOM { | 
					
						
							|  |  |  | template<> | 
					
						
							| 
									
										
										
										
											2022-12-12 12:20:02 +01:00
										 |  |  | inline bool Node::fast_is<HTML::NavigableContainer>() const { return is_navigable_container(); } | 
					
						
							| 
									
										
										
										
											2021-11-24 19:15:04 +03:00
										 |  |  | } |