LibWeb/HTML: Make environments top level creation URL nullable

This is explicitly set to null for Workers.
This commit is contained in:
Shannon Booth 2025-04-21 16:57:31 +12:00 committed by Andrew Kaster
parent a786269687
commit 96f38dc180
Notes: github-actions[bot] 2025-04-22 15:30:49 +00:00
6 changed files with 8 additions and 7 deletions

View file

@ -33,7 +33,8 @@ public:
URL::URL creation_url;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-creation-url
URL::URL top_level_creation_url;
// Null or a URL that represents the creation URL of the "top-level" environment. It is null for workers and worklets.
Optional<URL::URL> top_level_creation_url;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-origin
URL::Origin top_level_origin;
@ -51,7 +52,7 @@ public:
protected:
Environment() = default;
Environment(String id, URL::URL creation_url, URL::URL top_level_creation_url, URL::Origin top_level_origin, GC::Ptr<BrowsingContext> target_browsing_context)
Environment(String id, URL::URL creation_url, Optional<URL::URL> top_level_creation_url, URL::Origin top_level_origin, GC::Ptr<BrowsingContext> target_browsing_context)
: id(move(id))
, creation_url(move(creation_url))
, top_level_creation_url(move(top_level_creation_url))