2024-10-26 21:35:21 +13:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2024-11-08 16:03:45 +13:00
|
|
|
#include <LibWeb/Bindings/ShadowRealmExposedInterfaces.h>
|
2024-10-26 21:35:21 +13:00
|
|
|
#include <LibWeb/Bindings/ShadowRealmGlobalScopePrototype.h>
|
|
|
|
#include <LibWeb/HTML/ShadowRealmGlobalScope.h>
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(ShadowRealmGlobalScope);
|
2024-10-26 21:35:21 +13:00
|
|
|
|
|
|
|
ShadowRealmGlobalScope::ShadowRealmGlobalScope(JS::Realm& realm)
|
|
|
|
: DOM::EventTarget(realm)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ShadowRealmGlobalScope::~ShadowRealmGlobalScope() = default;
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<ShadowRealmGlobalScope> ShadowRealmGlobalScope::create(JS::Realm& realm)
|
2024-10-26 21:35:21 +13:00
|
|
|
{
|
2024-11-14 05:50:17 +13:00
|
|
|
return realm.create<ShadowRealmGlobalScope>(realm);
|
2024-10-26 21:35:21 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
void ShadowRealmGlobalScope::initialize(JS::Realm&)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2024-11-08 16:03:45 +13:00
|
|
|
void ShadowRealmGlobalScope::initialize_web_interfaces()
|
|
|
|
{
|
2024-11-08 16:35:16 +13:00
|
|
|
auto& realm = this->realm();
|
|
|
|
|
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(ShadowRealmGlobalScope);
|
|
|
|
|
2024-11-08 16:03:45 +13:00
|
|
|
add_shadow_realm_exposed_interfaces(*this);
|
2024-11-08 16:35:16 +13:00
|
|
|
Bindings::ShadowRealmGlobalScopeGlobalMixin::initialize(realm, *this);
|
2024-11-08 16:03:45 +13:00
|
|
|
}
|
|
|
|
|
2024-10-26 21:35:21 +13:00
|
|
|
void ShadowRealmGlobalScope::visit_edges(Cell::Visitor& visitor)
|
|
|
|
{
|
|
|
|
Base::visit_edges(visitor);
|
2024-11-18 22:49:00 +13:00
|
|
|
UniversalGlobalScopeMixin::visit_edges(visitor);
|
2024-10-26 21:35:21 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|