LibWeb: Hook TrustedTypes to the Workers api

This commit is contained in:
Tete17 2025-10-06 18:15:25 +02:00 committed by Luke Wilde
commit 74aa7e8a82
Notes: github-actions[bot] 2025-10-13 12:23:22 +00:00
4 changed files with 19 additions and 11 deletions

View file

@ -26,8 +26,8 @@ class Worker
GC_DECLARE_ALLOCATOR(Worker);
public:
static WebIDL::ExceptionOr<GC::Ref<Worker>> create(String const& script_url, WorkerOptions const& options, DOM::Document& document);
static WebIDL::ExceptionOr<GC::Ref<Worker>> construct_impl(JS::Realm& realm, String const& script_url, WorkerOptions const& options)
static WebIDL::ExceptionOr<GC::Ref<Worker>> create(TrustedTypes::TrustedScriptURLOrString const& script_url, WorkerOptions const& options, DOM::Document& document);
static WebIDL::ExceptionOr<GC::Ref<Worker>> construct_impl(JS::Realm& realm, TrustedTypes::TrustedScriptURLOrString const& script_url, WorkerOptions const& options)
{
auto& window = as<HTML::Window>(realm.global_object());
return Worker::create(script_url, options, window.associated_document());