LibWeb: Set the creation_url of worker environment settings objects

This originally was part of a FIXME in step 5 of "setup a worker
environment settings object". After this change, all the WPT subtests in
https://wpt.live/referrer-policy/gen/worker-classic.http-rp/no-referrer-when-downgrade/fetch.http.html
will pass!
This commit is contained in:
CountBleck
2026-01-06 07:41:29 -08:00
committed by Shannon Booth
parent bc0cceae1f
commit 625926bdeb
Notes: github-actions[bot] 2026-02-06 10:50:12 +00:00
2 changed files with 14 additions and 8 deletions

View File

@@ -35,6 +35,9 @@ GC::Ref<WorkerEnvironmentSettingsObject> WorkerEnvironmentSettingsObject::setup(
settings_object->target_browsing_context = nullptr;
// FIXME: 5. Set settings object's id to a new unique opaque string, creation URL to worker global scope's url, top-level creation URL to null, target browsing context to null, and active service worker to null.
// NB: WorkerHost sets (ad-hoc) the global scope's url to be the worker URL before redirects, as the spec does not
// do so at that point. See https://github.com/whatwg/html/issues/11340.
settings_object->creation_url = worker.url();
// 6. If worker global scope is a DedicatedWorkerGlobalScope object, then set settings object's top-level origin to
// outside settings's top-level origin.