From 32a7a2092eeff52aca78a0224816a9b327893cc6 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren WorkerGlobalScope object itself.
The location attribute must
- return the WorkerLocation object created for the WorkerGlobalScope
- object when the worker was created. It represents the WorkerGlobalScope object's
- url.
WorkerLocation object whose associated WorkerGlobalScope object is
+ the WorkerGlobalScope object.
+
+ While the WorkerLocation object is created after the
+ WorkerGlobalScope object, this is not problematic as it cannot be observed from
+ script.
Create a new WorkerLocation object and associate it with worker global
+ scope.
Let script be a new script.
@@ -96393,22 +96402,134 @@ interface WorkerNavigator {};[Exposed=Worker]
-interface WorkerLocation { };
-WorkerLocation implements URLUtilsReadOnly;
+interface WorkerLocation {
+ stringifier readonly attribute USVString href;
+ readonly attribute USVString origin;
+ readonly attribute USVString protocol;
+ readonly attribute USVString host;
+ readonly attribute USVString hostname;
+ readonly attribute USVString port;
+ readonly attribute USVString pathname;
+ readonly attribute USVString search;
+ readonly attribute USVString hash;
+};
+
+ A WorkerLocation object has an associated WorkerGlobalScope object (a
+ WorkerGlobalScope object).
+
+
The href attribute's getter must
+ return the associated WorkerGlobalScope object's
+ url, serialised.
The origin attribute's getter must
+ return the Unicode serialization of the
+ associated WorkerGlobalScope
+ object's url's origin.
It returns the Unicode rather than the ASCII serialisation for
+ compatibility with MessageEvent.
The protocol attribute's getter
+ must run return the associated WorkerGlobalScope object's
+ url's scheme, followed by ":".
The host attribute's getter must run
+ these steps:
Let url be the associated WorkerGlobalScope object's
+ url.
If url's host is null, return the empty + string.
If url's port is null, return + url's host, serialised.
Return url's host, serialised, followed by ":" and url's port, serialised.
The hostname attribute's getter
+ must run these steps:
Let host be the associated WorkerGlobalScope object's
+ url's host.
If host is null, return the empty string.
Return host serialised.
The port attribute's getter must run
+ these steps:
Let port be the WorkerGlobalScope object's url's port.
If port is null, return the empty string.
Return port, serialised.
The pathname attribute's getter
+ must run these steps:
Let url be the associated WorkerGlobalScope object's
+ url.
If url's non-relative flag is set, return the first string in + url's path.
A WorkerLocation object represents the WorkerGlobalScope object's
- url.
+
Return "/", followed by the strings in url's path (including empty strings), separated from each other by
+ "/".
The search attribute's getter must
+ run these steps:
The WorkerLocation interface supports the URLUtilsReadOnly
- interface.
Let query be the associated WorkerGlobalScope object's
+ url's query.
If query is either null or the empty string, return the empty string.
When the object is created, the user agent must invoke the element's
- URLUtilsReadOnly interface's set the
- input algorithm with the absolute URL that the WorkerLocation
- object represents as the given value.
Return "?", followed by query.
The element's URLUtilsReadOnly interface's get the base algorithm must return null.
The hash attribute's getter must run
+ these steps:
Let fragment be the associated WorkerGlobalScope object's
+ url's fragment.
If fragment is either null or the empty string, return the empty string.
Return "#", followed by fragment.