| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | /*
 | 
					
						
							| 
									
										
										
										
											2023-06-17 16:40:35 +02:00
										 |  |  |  * Copyright (c) 2020-2023, Andreas Kling <kling@serenityos.org> | 
					
						
							| 
									
										
										
										
											2023-01-18 17:41:12 +00:00
										 |  |  |  * Copyright (c) 2021-2023, Linus Groh <linusg@serenityos.org> | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-04-22 01:24:48 -07:00
										 |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <AK/Badge.h>
 | 
					
						
							|  |  |  | #include <AK/RefPtr.h>
 | 
					
						
							| 
									
										
										
										
											2022-09-07 20:30:31 +02:00
										 |  |  | #include <AK/TypeCasts.h>
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | #include <AK/URL.h>
 | 
					
						
							|  |  |  | #include <LibJS/Heap/Heap.h>
 | 
					
						
							| 
									
										
										
										
											2022-09-24 15:39:23 -06:00
										 |  |  | #include <LibWeb/Bindings/Intrinsics.h>
 | 
					
						
							| 
									
										
										
										
											2023-03-05 20:13:00 +00:00
										 |  |  | #include <LibWeb/Bindings/WindowGlobalMixin.h>
 | 
					
						
							| 
									
										
										
										
											2020-10-18 13:43:44 +02:00
										 |  |  | #include <LibWeb/DOM/EventTarget.h>
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | #include <LibWeb/Forward.h>
 | 
					
						
							| 
									
										
										
										
											2022-05-05 20:08:29 +01:00
										 |  |  | #include <LibWeb/HTML/AnimationFrameCallbackDriver.h>
 | 
					
						
							| 
									
										
										
										
											2022-09-24 14:02:47 +01:00
										 |  |  | #include <LibWeb/HTML/CrossOrigin/CrossOriginPropertyDescriptorMap.h>
 | 
					
						
							| 
									
										
										
										
											2021-09-22 16:39:15 +02:00
										 |  |  | #include <LibWeb/HTML/GlobalEventHandlers.h>
 | 
					
						
							| 
									
										
										
										
											2023-02-28 00:23:53 +00:00
										 |  |  | #include <LibWeb/HTML/MimeType.h>
 | 
					
						
							| 
									
										
										
										
											2023-08-22 15:50:49 +02:00
										 |  |  | #include <LibWeb/HTML/Navigable.h>
 | 
					
						
							| 
									
										
										
										
											2023-02-28 00:23:53 +00:00
										 |  |  | #include <LibWeb/HTML/Plugin.h>
 | 
					
						
							| 
									
										
										
										
											2022-10-23 04:05:46 +02:00
										 |  |  | #include <LibWeb/HTML/Scripting/ImportMap.h>
 | 
					
						
							| 
									
										
										
										
											2023-05-08 07:39:05 +02:00
										 |  |  | #include <LibWeb/HTML/ScrollOptions.h>
 | 
					
						
							| 
									
										
										
										
											2022-06-27 19:48:54 +01:00
										 |  |  | #include <LibWeb/HTML/WindowEventHandlers.h>
 | 
					
						
							| 
									
										
										
										
											2023-03-06 11:08:15 +00:00
										 |  |  | #include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
 | 
					
						
							| 
									
										
										
										
											2023-03-06 23:38:44 +00:00
										 |  |  | #include <LibWeb/RequestIdleCallback/IdleRequest.h>
 | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-07 23:08:26 +01:00
										 |  |  | namespace Web::HTML { | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-31 21:55:01 +02:00
										 |  |  | class IdleCallback; | 
					
						
							| 
									
										
										
										
											2021-09-13 02:03:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 20:53:49 +00:00
										 |  |  | // https://w3c.github.io/csswg-drafts/cssom-view/#dictdef-scrolltooptions
 | 
					
						
							|  |  |  | struct ScrollToOptions : public ScrollOptions { | 
					
						
							|  |  |  |     Optional<double> left; | 
					
						
							|  |  |  |     Optional<double> top; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-18 13:43:44 +02:00
										 |  |  | class Window final | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     : public DOM::EventTarget | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     , public GlobalEventHandlers | 
					
						
							|  |  |  |     , public WindowEventHandlers | 
					
						
							| 
									
										
										
										
											2023-03-06 11:08:15 +00:00
										 |  |  |     , public WindowOrWorkerGlobalScopeMixin | 
					
						
							| 
									
										
										
										
											2023-03-05 15:52:34 +00:00
										 |  |  |     , public Bindings::WindowGlobalMixin { | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     WEB_PLATFORM_OBJECT(Window, DOM::EventTarget); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] static JS::NonnullGCPtr<Window> create(JS::Realm&); | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     ~Window(); | 
					
						
							| 
									
										
										
										
											2020-10-18 13:43:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 11:19:16 +00:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::atob; | 
					
						
							| 
									
										
										
										
											2023-03-06 11:14:45 +00:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::btoa; | 
					
						
							| 
									
										
										
										
											2023-03-14 07:28:08 -04:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::clear_interval; | 
					
						
							|  |  |  |     using WindowOrWorkerGlobalScopeMixin::clear_timeout; | 
					
						
							| 
									
										
										
										
											2023-03-07 18:15:52 +00:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::fetch; | 
					
						
							| 
									
										
										
										
											2023-03-07 18:25:18 +00:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::queue_microtask; | 
					
						
							| 
									
										
										
										
											2023-03-14 07:28:08 -04:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::set_interval; | 
					
						
							|  |  |  |     using WindowOrWorkerGlobalScopeMixin::set_timeout; | 
					
						
							| 
									
										
										
										
											2023-03-07 18:21:49 +00:00
										 |  |  |     using WindowOrWorkerGlobalScopeMixin::structured_clone; | 
					
						
							| 
									
										
										
										
											2023-03-06 11:14:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 11:08:15 +00:00
										 |  |  |     // ^DOM::EventTarget
 | 
					
						
							| 
									
										
										
										
											2022-08-08 22:29:40 +02:00
										 |  |  |     virtual bool dispatch_event(DOM::Event&) override; | 
					
						
							| 
									
										
										
										
											2020-10-18 13:43:44 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 11:08:15 +00:00
										 |  |  |     // ^WindowOrWorkerGlobalScopeMixin
 | 
					
						
							|  |  |  |     virtual Bindings::PlatformObject& this_impl() override { return *this; } | 
					
						
							|  |  |  |     virtual Bindings::PlatformObject const& this_impl() const override { return *this; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 16:44:15 +00:00
										 |  |  |     // ^JS::Object
 | 
					
						
							|  |  |  |     virtual JS::ThrowCompletionOr<bool> internal_set_prototype_of(JS::Object* prototype) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-09 13:45:03 +02:00
										 |  |  |     Page* page(); | 
					
						
							|  |  |  |     Page const* page() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-05 00:13:13 +01:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window
 | 
					
						
							| 
									
										
										
										
											2022-03-07 23:08:26 +01:00
										 |  |  |     DOM::Document const& associated_document() const { return *m_associated_document; } | 
					
						
							|  |  |  |     DOM::Document& associated_document() { return *m_associated_document; } | 
					
						
							| 
									
										
										
										
											2022-08-04 21:19:30 +02:00
										 |  |  |     void set_associated_document(DOM::Document&); | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-05 00:13:13 +01:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/window-object.html#window-bc
 | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     BrowsingContext const* browsing_context() const; | 
					
						
							|  |  |  |     BrowsingContext* browsing_context(); | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-22 15:50:49 +02:00
										 |  |  |     JS::GCPtr<Navigable> navigable() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-05 20:37:41 +00:00
										 |  |  |     size_t document_tree_child_browsing_context_count() const; | 
					
						
							| 
									
										
										
										
											2022-09-06 19:56:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-23 04:05:46 +02:00
										 |  |  |     ImportMap const& import_map() const { return m_import_map; } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool import_maps_allowed() const { return m_import_maps_allowed; } | 
					
						
							|  |  |  |     void set_import_maps_allowed(bool import_maps_allowed) { m_import_maps_allowed = import_maps_allowed; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     WebIDL::ExceptionOr<JS::GCPtr<WindowProxy>> open_impl(StringView url, StringView target, StringView features); | 
					
						
							| 
									
										
										
										
											2022-05-05 20:08:29 +01:00
										 |  |  |     bool has_animation_frame_callbacks() const { return m_animation_frame_callback_driver.has_callbacks(); } | 
					
						
							| 
									
										
										
										
											2020-06-27 18:30:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     void did_set_location_href(Badge<Location>, AK::URL const& new_href); | 
					
						
							|  |  |  |     void did_call_location_replace(Badge<Location>, DeprecatedString url); | 
					
						
							| 
									
										
										
										
											2020-05-18 21:52:50 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     DOM::Event* current_event() { return m_current_event.ptr(); } | 
					
						
							|  |  |  |     DOM::Event const* current_event() const { return m_current_event.ptr(); } | 
					
						
							| 
									
										
										
										
											2022-08-08 22:29:40 +02:00
										 |  |  |     void set_current_event(DOM::Event* event); | 
					
						
							| 
									
										
										
										
											2020-11-21 18:32:39 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-08 16:51:33 +00:00
										 |  |  |     Optional<CSS::MediaFeatureValue> query_media_feature(CSS::MediaFeatureID) const; | 
					
						
							| 
									
										
										
										
											2021-09-11 00:33:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-09 11:17:42 +02:00
										 |  |  |     void fire_a_page_transition_event(FlyString const& event_name, bool persisted); | 
					
						
							| 
									
										
										
										
											2021-09-26 12:39:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<Storage>> local_storage(); | 
					
						
							|  |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<Storage>> session_storage(); | 
					
						
							| 
									
										
										
										
											2022-02-08 19:38:29 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-31 21:55:01 +02:00
										 |  |  |     void start_an_idle_period(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-05 20:08:29 +01:00
										 |  |  |     AnimationFrameCallbackDriver& animation_frame_callback_driver() { return m_animation_frame_callback_driver; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-09-19 17:46:34 +02:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/interaction.html#transient-activation
 | 
					
						
							|  |  |  |     bool has_transient_activation() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-05 21:22:34 +00:00
										 |  |  |     WebIDL::ExceptionOr<void> initialize_web_interfaces(Badge<WindowEnvironmentSettingsObject>); | 
					
						
							| 
									
										
										
										
											2022-09-24 15:39:23 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-28 00:23:53 +00:00
										 |  |  |     Vector<JS::NonnullGCPtr<Plugin>> pdf_viewer_plugin_objects(); | 
					
						
							|  |  |  |     Vector<JS::NonnullGCPtr<MimeType>> pdf_viewer_mime_type_objects(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 16:44:15 +00:00
										 |  |  |     CrossOriginPropertyDescriptorMap const& cross_origin_property_descriptor_map() const { return m_cross_origin_property_descriptor_map; } | 
					
						
							|  |  |  |     CrossOriginPropertyDescriptorMap& cross_origin_property_descriptor_map() { return m_cross_origin_property_descriptor_map; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-23 08:46:46 +12:00
										 |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::CallbackType>> count_queuing_strategy_size_function(); | 
					
						
							| 
									
										
										
										
											2023-06-23 08:49:12 +12:00
										 |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<WebIDL::CallbackType>> byte_length_queuing_strategy_size_function(); | 
					
						
							| 
									
										
										
										
											2023-06-23 08:46:46 +12:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-05 16:02:35 +00:00
										 |  |  |     // JS API functions
 | 
					
						
							| 
									
										
										
										
											2023-03-05 18:36:43 +00:00
										 |  |  |     JS::NonnullGCPtr<WindowProxy> window() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 18:38:29 +00:00
										 |  |  |     JS::NonnullGCPtr<WindowProxy> self() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 18:54:33 +00:00
										 |  |  |     JS::NonnullGCPtr<DOM::Document const> document() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 19:02:16 +00:00
										 |  |  |     String name() const; | 
					
						
							|  |  |  |     void set_name(String const&); | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<Location> location(); | 
					
						
							| 
									
										
										
										
											2023-03-05 20:21:35 +00:00
										 |  |  |     JS::NonnullGCPtr<History> history() const; | 
					
						
							| 
									
										
										
										
											2023-08-23 10:58:09 -06:00
										 |  |  |     JS::NonnullGCPtr<Navigation> navigation(); | 
					
						
							| 
									
										
										
										
											2023-03-06 22:25:04 +00:00
										 |  |  |     void focus(); | 
					
						
							| 
									
										
										
										
											2023-03-05 18:36:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-05 18:48:45 +00:00
										 |  |  |     JS::NonnullGCPtr<WindowProxy> frames() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 20:37:41 +00:00
										 |  |  |     u32 length() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 20:43:53 +00:00
										 |  |  |     JS::GCPtr<WindowProxy const> top() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 21:01:54 +00:00
										 |  |  |     JS::GCPtr<WindowProxy const> parent() const; | 
					
						
							| 
									
										
										
										
											2023-03-05 21:33:30 +00:00
										 |  |  |     JS::GCPtr<DOM::Element const> frame_element() const; | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     WebIDL::ExceptionOr<JS::GCPtr<WindowProxy>> open(Optional<String> const& url, Optional<String> const& target, Optional<String> const& features); | 
					
						
							| 
									
										
										
										
											2023-03-05 18:48:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<Navigator> navigator(); | 
					
						
							| 
									
										
										
										
											2023-03-05 17:55:03 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-05 16:02:35 +00:00
										 |  |  |     void alert(String const& message = {}); | 
					
						
							| 
									
										
										
										
											2023-03-05 17:21:24 +00:00
										 |  |  |     bool confirm(Optional<String> const& message); | 
					
						
							| 
									
										
										
										
											2023-03-05 17:28:17 +00:00
										 |  |  |     Optional<String> prompt(Optional<String> const& message, Optional<String> const& default_); | 
					
						
							| 
									
										
										
										
											2023-03-05 16:02:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-05 17:36:59 +00:00
										 |  |  |     void post_message(JS::Value message, String const&); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 19:50:29 +00:00
										 |  |  |     Variant<JS::Handle<DOM::Event>, JS::Value> event() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<CSS::CSSStyleDeclaration> get_computed_style(DOM::Element&, Optional<String> const& pseudo_element) const; | 
					
						
							| 
									
										
										
										
											2023-03-06 22:18:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 19:51:05 +00:00
										 |  |  |     WebIDL::ExceptionOr<JS::NonnullGCPtr<CSS::MediaQueryList>> match_media(String const& query); | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<CSS::Screen> screen(); | 
					
						
							|  |  |  |     [[nodiscard]] JS::GCPtr<CSS::VisualViewport> visual_viewport(); | 
					
						
							| 
									
										
										
										
											2023-03-06 19:51:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 19:51:33 +00:00
										 |  |  |     i32 inner_width() const; | 
					
						
							|  |  |  |     i32 inner_height() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 19:51:44 +00:00
										 |  |  |     double scroll_x() const; | 
					
						
							|  |  |  |     double scroll_y() const; | 
					
						
							| 
									
										
										
										
											2023-03-06 20:53:49 +00:00
										 |  |  |     void scroll(ScrollToOptions const&); | 
					
						
							|  |  |  |     void scroll(double x, double y); | 
					
						
							| 
									
										
										
										
											2023-03-06 21:17:19 +00:00
										 |  |  |     void scroll_by(ScrollToOptions); | 
					
						
							|  |  |  |     void scroll_by(double x, double y); | 
					
						
							| 
									
										
										
										
											2023-03-06 19:51:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 21:38:09 +00:00
										 |  |  |     i32 screen_x() const; | 
					
						
							|  |  |  |     i32 screen_y() const; | 
					
						
							| 
									
										
										
										
											2023-03-06 22:02:09 +00:00
										 |  |  |     i32 outer_width() const; | 
					
						
							|  |  |  |     i32 outer_height() const; | 
					
						
							| 
									
										
										
										
											2023-03-06 22:10:10 +00:00
										 |  |  |     double device_pixel_ratio() const; | 
					
						
							| 
									
										
										
										
											2023-03-06 21:38:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-07 18:12:58 +00:00
										 |  |  |     i32 request_animation_frame(WebIDL::CallbackType&); | 
					
						
							| 
									
										
										
										
											2023-03-07 18:14:33 +00:00
										 |  |  |     void cancel_animation_frame(i32 handle); | 
					
						
							| 
									
										
										
										
											2023-03-07 18:12:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 23:38:44 +00:00
										 |  |  |     u32 request_idle_callback(WebIDL::CallbackType&, RequestIdleCallback::IdleRequestOptions const&); | 
					
						
							| 
									
										
										
										
											2023-03-06 23:43:25 +00:00
										 |  |  |     void cancel_idle_callback(u32 handle); | 
					
						
							| 
									
										
										
										
											2023-03-06 23:38:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-06 22:34:48 +00:00
										 |  |  |     JS::GCPtr<Selection::Selection> get_selection() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<HighResolutionTime::Performance> performance(); | 
					
						
							| 
									
										
										
										
											2023-03-06 19:50:46 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<Crypto::Crypto> crypto(); | 
					
						
							| 
									
										
										
										
											2023-03-06 19:50:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-13 13:05:26 +02:00
										 |  |  |     [[nodiscard]] JS::NonnullGCPtr<CustomElementRegistry> custom_elements(); | 
					
						
							| 
									
										
										
										
											2023-03-29 23:46:18 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-31 00:13:56 +02:00
										 |  |  |     HighResolutionTime::DOMHighResTimeStamp get_last_activation_timestamp() const { return m_last_activation_timestamp; } | 
					
						
							|  |  |  |     void set_last_activation_timestamp(HighResolutionTime::DOMHighResTimeStamp timestamp) { m_last_activation_timestamp = timestamp; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-21 11:59:49 +02:00
										 |  |  |     static void set_internals_object_exposed(bool); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     explicit Window(JS::Realm&); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     virtual void visit_edges(Cell::Visitor&) override; | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-22 16:39:15 +02:00
										 |  |  |     // ^HTML::GlobalEventHandlers
 | 
					
						
							| 
									
										
										
										
											2023-04-06 07:25:18 +02:00
										 |  |  |     virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const&) override { return *this; } | 
					
						
							| 
									
										
										
										
											2021-09-22 16:39:15 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-06-27 19:48:54 +01:00
										 |  |  |     // ^HTML::WindowEventHandlers
 | 
					
						
							|  |  |  |     virtual DOM::EventTarget& window_event_handlers_to_event_target() override { return *this; } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-03-31 21:55:01 +02:00
										 |  |  |     void invoke_idle_callbacks(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-09 13:55:31 +02:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     JS::GCPtr<DOM::Document> m_associated_document; | 
					
						
							| 
									
										
										
										
											2021-09-09 13:55:31 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     JS::GCPtr<DOM::Event> m_current_event; | 
					
						
							| 
									
										
										
										
											2020-06-27 18:30:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-23 04:05:46 +02:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/webappapis.html#concept-window-import-map
 | 
					
						
							|  |  |  |     ImportMap m_import_map; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/webappapis.html#import-maps-allowed
 | 
					
						
							|  |  |  |     bool m_import_maps_allowed { true }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  |     JS::GCPtr<HighResolutionTime::Performance> m_performance; | 
					
						
							| 
									
										
										
										
											2022-09-04 13:15:05 +02:00
										 |  |  |     JS::GCPtr<Crypto::Crypto> m_crypto; | 
					
						
							| 
									
										
										
										
											2022-08-31 18:52:54 +02:00
										 |  |  |     JS::GCPtr<CSS::Screen> m_screen; | 
					
						
							| 
									
										
										
										
											2023-03-11 18:11:20 +00:00
										 |  |  |     JS::GCPtr<Navigator> m_navigator; | 
					
						
							|  |  |  |     JS::GCPtr<Location> m_location; | 
					
						
							| 
									
										
										
										
											2021-09-13 02:03:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-08-23 10:58:09 -06:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/nav-history-apis.html#window-navigation-api
 | 
					
						
							|  |  |  |     JS::GCPtr<Navigation> m_navigation; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-29 23:46:18 +01:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-api
 | 
					
						
							|  |  |  |     // Each Window object is associated with a unique instance of a CustomElementRegistry object, allocated when the Window object is created.
 | 
					
						
							|  |  |  |     JS::GCPtr<CustomElementRegistry> m_custom_element_registry; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-05-05 20:08:29 +01:00
										 |  |  |     AnimationFrameCallbackDriver m_animation_frame_callback_driver; | 
					
						
							| 
									
										
										
										
											2022-03-31 21:55:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://w3c.github.io/requestidlecallback/#dfn-list-of-idle-request-callbacks
 | 
					
						
							| 
									
										
										
										
											2023-03-06 14:17:01 +01:00
										 |  |  |     Vector<NonnullRefPtr<IdleCallback>> m_idle_request_callbacks; | 
					
						
							| 
									
										
										
										
											2022-03-31 21:55:01 +02:00
										 |  |  |     // https://w3c.github.io/requestidlecallback/#dfn-list-of-runnable-idle-callbacks
 | 
					
						
							| 
									
										
										
										
											2023-03-06 14:17:01 +01:00
										 |  |  |     Vector<NonnullRefPtr<IdleCallback>> m_runnable_idle_callbacks; | 
					
						
							| 
									
										
										
										
											2022-03-31 21:55:01 +02:00
										 |  |  |     // https://w3c.github.io/requestidlecallback/#dfn-idle-callback-identifier
 | 
					
						
							|  |  |  |     u32 m_idle_callback_identifier = 0; | 
					
						
							| 
									
										
										
										
											2022-08-28 13:42:07 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-02-28 00:23:53 +00:00
										 |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#pdf-viewer-plugin-objects
 | 
					
						
							|  |  |  |     Vector<JS::NonnullGCPtr<Plugin>> m_pdf_viewer_plugin_objects; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/system-state.html#pdf-viewer-mime-type-objects
 | 
					
						
							|  |  |  |     Vector<JS::NonnullGCPtr<MimeType>> m_pdf_viewer_mime_type_objects; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-11 16:44:15 +00:00
										 |  |  |     // [[CrossOriginPropertyDescriptorMap]], https://html.spec.whatwg.org/multipage/browsers.html#crossoriginpropertydescriptormap
 | 
					
						
							|  |  |  |     CrossOriginPropertyDescriptorMap m_cross_origin_property_descriptor_map; | 
					
						
							| 
									
										
										
										
											2023-05-31 00:13:56 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://html.spec.whatwg.org/multipage/interaction.html#user-activation-data-model
 | 
					
						
							|  |  |  |     HighResolutionTime::DOMHighResTimeStamp m_last_activation_timestamp { NumericLimits<double>::max() }; | 
					
						
							| 
									
										
										
										
											2023-06-23 08:46:46 +12:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://streams.spec.whatwg.org/#count-queuing-strategy-size-function
 | 
					
						
							|  |  |  |     JS::GCPtr<WebIDL::CallbackType> m_count_queuing_strategy_size_function; | 
					
						
							| 
									
										
										
										
											2023-06-23 08:49:12 +12:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // https://streams.spec.whatwg.org/#byte-length-queuing-strategy-size-function
 | 
					
						
							|  |  |  |     JS::GCPtr<WebIDL::CallbackType> m_byte_length_queuing_strategy_size_function; | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-03 16:28:14 +02:00
										 |  |  | void run_animation_frame_callbacks(DOM::Document&, double now); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-01 18:53:28 +02:00
										 |  |  | } |