From d934782d8b7e96fcb8d0891afb52dede6dd26a00 Mon Sep 17 00:00:00 2001
From: Ian Hickson HTML
- Living Standard — Last Updated 28 October 2013
+ Living Standard — Last Updated 30 October 2013
Living Standard — Last Updated 28 October 2013
ErrorEvent
interface
Living Standard — Last Updated 28 October 2013
Worker
interfaceSharedWorker
interface
2.5.2 Resolving URLs
3.1 Documents
their user interface. This is the primary mechanism by which a user can tell if a site is
attempting to impersonate another.
When a Document
is created by a script using
the createDocument()
or createHTMLDocument()
APIs, the
- document's address is the same as the document's address of the script's
- document, and the Document
is both ready for post-load tasks and
+ document's address is the same as the document's address of the responsible
+ document specified by the script's settings
+ object, and the Document
is both ready for post-load tasks and
completely loaded immediately.
The document's referrer is an absolute URL that can be set when the @@ -8820,6 +8825,8 @@
Let document be the XMLDocument
object on which the
method was invoked.
Resolve the method's first argument, relative to the
- entry script's base URL. If this is not
+ API base URL specified by the
+ entry script's settings object. If this is not
successful, throw a SyntaxError
exception and abort these steps. Otherwise, let url be the resulting absolute URL.
If the origin of url is not the same as the @@ -9112,9 +9121,10 @@
Let success be false.
Fetch url from the origin of - document, using the entry script's referrer source, with the synchronous flag set and the force same-origin flag set.
Let old script element be the value to which the
- Document
element's currentScript
object was most recently
+ script
element's Document
's currentScript
object was most recently
initialized.
Initialize the Document
element's currentScript
object to the script
+
+
Initialize the script
element's Document
's currentScript
object to the script
element.
Create a script from the
- script
element node, using the script block's source, the
- URL from which the script was obtained, and the script block's
- type.
Create a script, using the script block's source, the
+ URL from which the script was obtained, the script block's
+ type as the scripting language, and the script settings object of the script
element's
+ Document
's Window
object.
If the script came from a resource that was fetched in the - steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script from a node - algorithm.
+ steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script + algorithm as well.This is where the script is compiled and actually executed.
@@ -51877,7 +51891,8 @@Initialize the Initialize the Document
element's currentScript
object to old script
+
+ script
element's Document
's currentScript
object to old script
element.
Window
object had their [[Enumerable]]
attribute set to false.
+
For members that return objects (including function objects), each distinct effective
script origin that is not the same as the Window
object's
Document
's effective script origin must be provided with a separate set
of objects. These objects must have the prototype chain appropriate for the script for which the
- objects are created (not those that would be appropriate for scripts whose script's global
- object is the Window
object in question).
Window
object in question).
The first argument, url, must be a valid non-empty URL for a
page to load in the browsing context. If the first argument is the empty string, then the url argument must be interpreted as "about:blank
". Otherwise, the
argument must be resolved to an absolute URL (or
- an error), relative to the entry script's base
- URL, when the method is invoked.
The second argument, target, specifies the name of the browsing context that is to be navigated. It must be a valid
@@ -64378,13 +64396,14 @@ InvalidAccessError exception and abort these
steps.
Otherwise, if url is not "about:blank
", the user agent must
navigate the selected browsing context to the
absolute URL obtained from resolving url earlier. If the replace is true or if the browsing
context was just created as part of the rules for choosing a browsing context given a
browsing context name, then replacement must be
- enabled. The navigation must be done with the browsing context of the incumbent script as the source browsing
+ enabled. The navigation must be done with the responsible
+ browsing context specified by the incumbent script's settings object as the source browsing
context. If the resolve a URL algorithm failed, then the user agent may either
instead navigate to an inline error page, using the same replacement behavior and
source browsing context behavior as described earlier in this paragraph; or treat the url as "about:blank
", acting as described in the next paragraph.
A browsing context is script-closable if it is an auxiliary
@@ -64462,13 +64485,15 @@ The Each script has a strong reference to its browsing context and its document. Each script has a strong reference to its settings
+ object, and each script settings object
+ has strong references to its global object, responsible browsing context, and responsible document. When a browsing context is to discard a When the When the Navigation for the Navigation for the If the resolving step of the The element's The element's For members that return objects (including function objects), each distinct effective
script origin that is not the same origin as the Make disappear any Make disappear any If this affected any 6.2.3 Accessin
length
IDL attribute on the Window
interface must return the number of child browsing
contexts that are nested through
elements that are in the Document
that is the
active document of that Window
object, if that Window
's
- browsing context shares the same event loop as the script's
- browsing context of the entry script accessing the IDL attribute; otherwise,
+ browsing context shares the same event loop as the responsible
+ document specified by the settings object of the
+ entry script accessing the IDL attribute; otherwise,
it must return zero.6.2.5 G
objects have implied strong references to the
WindowProxy
object.
- Document
, the user
@@ -65921,8 +65948,9 @@ 6.5.2 The
If the third argument is not null, run these substeps:
-
's active document's effective script origin, with the
following exceptions:
- SecurityError
exception and abort these steps.6.5.2 The
query, and fragment components, then throw a
SecurityError
exception and abort these steps.
+
SecurityError
exception
and abort these steps. (This prevents sandboxed content from spoofing other pages on the same
origin.)6.5.3 The
The relevant
Document
is the Location
object's associated
Document
object's browsing context's active document.
+
assign(url)
method is invoked, the UA must resolve the argument, relative
- to the entry script's base URL, and if that is
+ to the API base URL specified by the entry script's settings object, and if that is
successful, must navigate the browsing
context to the specified url. If the browsing context's
session history contains only one Document
, and that was the
@@ -66201,14 +66231,16 @@ 6.5.3 The
+
replace(url)
method is invoked, the UA must resolve the argument, relative
- to the entry script's base URL, and if that is
+ to the API base URL specified by the entry script's settings object, and if that is
successful, navigate the browsing
context to the specified url with replacement enabled.assign()
and replace()
methods must be done with the browsing context of the incumbent script as the source
+
+ assign()
and replace()
methods must be done with the responsible browsing context specified by
+ the incumbent script's settings object as the source
browsing context.assign()
and replace()
methods is not successful, then the user agent must
@@ -66272,9 +66304,10 @@ 6.5.3 The
algorithm with the address of the
relevant
Document
as the given value.URLUtils
interface's get the
- base algorithm must return the entry script's base URL, if there is one, or null otherwise.URLUtils
interface's query
encoding is the document's character encoding.6.5.3.1 Security
contexthref
setter, if the entry script's
- script's browsing context is familiar with the browsing
+ href
setter, if the responsible browsing context
+ specified by the entry script's
+ settings object is familiar with the browsing
context with which the Location
object is associated
- replace()
method, if the entry
- script's script's browsing context is familiar with the
+
+ replace()
method, if the responsible
+ browsing context specified by the entry script's
+ settings object is familiar with the
browsing context with which the Location
object is associated
Location
object or indirectly via
@@ -66345,12 +66381,13 @@ 6.5.3.1 Security
properties, getters, setters, etc, were not present, and as if all the properties of that
Location
object had their [[Enumerable]] attribute set to false.
+
Location
object's Document
's effective script origin must be provided with a
separate set of objects. These objects must have the prototype chain appropriate for the script
for which the objects are created (not those that would be appropriate for scripts whose
- script's global object is the Location
object's Document
's
+ settings object specifies a global object that is the Location
object's Document
's
Window
object).6.6.11 Unloading documents
WebSocket
objects that were created by the WebSocket()
constructor whose global object is the
+ WebSocket
objects that were created by the WebSocket()
constructor from the
Document
's Window
object.WebSocket
objects, then set Document
's salvageable state to false.7.1.3.1 Definitions
information).
A script settings object specifies algorithms for obtaining the following:
+ +An object that provides the APIs that the code can use.
- -This is typically a Window
object. In JavaScript, this
- corresponds to the global object.
An object that provides the APIs that can be called by the code in scripts that use this + settings object.
-When a script's global object is an empty object, it can't do - anything that interacts with the environment.
+This is typically a Window
object or a
+ WorkerGlobalScope
object. When a global object is an empty object, it
+ can't do anything that interacts with the environment.
If the script's global object is a Window
object, then in
+
+
If the global object is a Window
object, then, in
JavaScript, the ThisBinding of the global execution context for this script must be the
Window
object's WindowProxy
object, rather than the global object. [ECMA262]
A browsing context that is assigned responsibility for actions taken by the - script.
+ scripts that use this script settings object.When a script creates and navigates a new
- top-level browsing context, the opener
attribute of
- the new browsing context's Window
object will be set to the
- script's browsing context's WindowProxy
object.
opener
attribute
+ of the new browsing context's Window
object will be set to the
+ responsible browsing context's WindowProxy
object.
A Document
that is assigned responsibility for actions taken by the script.
A Document
that is assigned responsibility for actions taken by the scripts that
+ use this script settings object.
For example, the address of the
- script's document is used to set the address of any Document
elements created using createDocument()
.
Document
s created using createDocument()
.
+
+ An event loop that is used when it would not be immediately clear what event + loop to use.
Either a Document
(specifically, the script's document), or a
+
Either a Document
(specifically, the responsible document), or a
URL, which is used by some APIs to determine what value to use for the Referer
(sic) header in calls to the fetching algorithm.
A character encoding, set when the script is created, used to encode URLs. If the character encoding is set from another source, e.g. a - document's character encoding, then the script's URL character - encoding must follow the source, so that if the source's changes, so does the - script's.
+ +A character encoding used to encode URLs by APIs called by scripts that use + this script settings object.
A URL, set when the script is created, used to resolve relative URLs. If the base URL is set from another - source, e.g. a document base URL, then the script's base URL must - follow the source, so that if the source's changes, so does the script's.
+ +An absolute URL used by APIs called by scripts that use + this script settings object to resolve relative URLs.
Whenever a new Window
object is created, it must also create a script
+ settings object whose algorithms are defined as follows:
When the script settings object is created, for each language supported by the + user agent, create an appropriate execution environment as defined by the relevant + specification.
+ +When a script execution environment is needed, return the appropriate one from + those created when the script settings object was created.
+ +Return the Window
object itself.
Return the browsing context with which the Window
object is
+ associated.
Return the Document
with which the Window
is currently
+ associated.
Return the event loop that is associated with the unit of related
+ similar-origin browsing contexts to which the Window
object's browsing
+ context belongs.
Return the Document
with which the Window
is currently
+ associated.
Return the current character encoding of
+ the Document
with which the Window
is currently associated.
Return the current base URL of the
+ Document
with which the Window
is currently associated.
Each unit of related similar-origin browsing contexts has a stack of incumbent scripts, which must be initially empty. When a new script is pushed onto @@ -70048,8 +70163,10 @@
Make the script execution environment
- for s execute the script's code
+
+ Make the appropriate script execution environment
+ specified by s's settings
+ object execute the script's code
entry-point.7.1.3.2 Calling scripts
script o, and return either "run" or "do
not run".
If the global object of o +
If the global object specified by o's settings object
is a Window
object whose Document
object is not fully
active, then return "do not run" and abort these steps.
If scripting is disabled for o's browsing context, then return + +
If scripting is disabled for the responsible browsing context specified by o's settings object, then return "do not run" and abort these steps.
Push s onto the stack of incumbent scripts, and label it @@ -70102,7 +70220,7 @@
The entry script is the most-recently added script in the stack of incumbent scripts that is labeled as a candidate entry script. If the stack is empty, or has no entries labeled as such, then there is no entry script. It is used - to obtain, amongst other things, the script's base URL to resolve relative URLs used in scripts running in that unit of related similar-origin browsing contexts.
@@ -70134,12 +70252,11 @@When the specification says that a script is to be created, given some script source, a script source URL, its - scripting language, a global object, a browsing context, a document, a referrer source, a URL - character encoding, a base URL, and optionally a muted errors flag, the user - agent must run the following steps:
+ scripting language, a script settings object, and optionally a muted + errors flag, the user agent must run the following steps:Let script be a new script that this algorithm will subsequently initialize.
Set up a script execution environment as appropriate for the given scripting - language.
Obtain the appropriate script execution environment for the given scripting + language from the script settings object provided.
Parse/compile/initialize the source of the script using the script execution environment, as appropriate for the scripting language, and thus obtain script's code entry-point.
Set up the script's global object, the script's browsing - context, the script's document, the script's referrer source, - the script's URL character encoding, and the script's base URL from the - settings passed to this algorithm.
Let script's settings object be the script + settings object provided.
If the muted errors flag was set, then set script's muted errors flag.
Otherwise, report the error for script, with the problematic - position (line number and column number), using the script's global object as the + position (line number and column number), using the global object specified by the script settings object as the target. If the error is still not handled after this, then the error may be reported to the user.
-When the specification says that a script is to be created from a node node, given some - script source, its URL, its scripting language, and optionally a muted errors - flag, the user agent must create a script, using the given script source, URL, and - scripting language, the script settings determined from the node node, and, if the muted errors flag was set in the call to this - algorithm, the muted errors flag.
- -The script settings determined from the node node are computed - as follows:
- -Let document be the Document
of node
- (or node itself if it is a Document
).
The global object is the Window
object of document.
The browsing context is the browsing context of document.
- -The document is document.
- -The referrer source is document.
- -The URL character encoding is the character - encoding of document. (This is a reference, - not a copy.)
The base URL is the base URL of document. (This is a reference, not a copy.)
User agents may impose resource limitations on scripts, for example CPU quotas, memory limits, total execution time limits, or bandwidth limitations. When a script exceeds a limit, the user @@ -70241,7 +70331,7 @@
When the user agent is required to report an error for a particular script script with a particular @@ -70314,11 +70404,12 @@
If event was canceled, then the error is handled. Otherwise, the error is not handled.
-Whenever an uncaught runtime script error occurs in one of the scripts associated with a
Document
, the user agent must report the error for the relevant script, with the problematic position (line number and column
- number) in the resource containing the script, using the script's global object as
+ number) in the resource containing the script, using the global object specified by the script's settings object as
the target. If the error is still not handled after this,
then the error may be reported to the user.
ErrorEvent
interfaceErrorEvent
interface[Constructor(DOMString type, optional ErrorEventInit eventInitDict)] interface ErrorEvent : Event { @@ -70437,7 +70528,7 @@7.1.4.1 Definitions
the task was queued in the context of a browsing context, then it is the browsing context's active document at the time the task was queued; if the task was queued by or for a script then the document is - the script's document. + the responsible document specified by the script's settings object.A task is intended for a specific event loop: the event loop that is handling tasks for the task's associated
@@ -70529,9 +70620,10 @@Document
.7.1.4.2 Processing model
Invoke MutationObserver
objects for the
- unit of related similar-origin browsing contexts to which the script's
- browsing context belongs, using the task wrapper algorithm as the steps to
+ unit of related similar-origin browsing contexts to which the responsible
+ browsing context specified by the script's settings object belongs, using the task wrapper algorithm as the steps to
invoke each callback.
This will typically invoke scripted callbacks, which calls the jump to a
@@ -70716,10 +70808,10 @@ 7.1.5 address be the address of the
creator
Document
instead.
Create a script from the
- Document
node of the active document, using the aforementioned
- script source, the URL of the resource where the javascript:
URL,
- was found, and assuming the scripting language is JavaScript.
Create a script, using the aforementioned script source, the URL
+ of the resource where the javascript:
URL, was found, JavaScript as the scripting
+ language, and the script settings object of the Window
object of the
+ active document.
Let result be the return value of the code entry-point of this script. If an exception was thrown, let result be void instead. (The result will be void also if scripting is disabled.)
@@ -70846,7 +70938,11 @@Set the corresponding event handler to null.
Set up a script execution environment for JavaScript.
Let script settings be the script settings object of the
+ Window
object associated with the browsing context to which belongs the
+ Document
of the element in question.
Obtain the script execution environment for JavaScript from script settings.
Let body be the event handler content attribute's new value.
Using the script execution environment created above, create a function object (as defined in + +
Using the script execution environment obtained above, create a function object (as defined in ECMAScript edition 5 section 13.2 Creating Function Objects), with:
Let this new function be the script's code entry-point.
+Let this new function be a new script's code entry-point.
Set up the script's global object, the script's browsing - context, the script's document, the script's referrer source, - the script's URL character encoding, and the script's base URL from - the script settings determined from the node on which the attribute is being - set.
Let that script's settings object be + script settings.
Set the corresponding event handler to the aforementioned function.
Remove all child nodes of the document, without firing any mutation events.
Replace the Document
's singleton objects with new instances of those objects.
- (This includes in particular the Window
, Location
,
- History
, ApplicationCache
, and Navigator
, objects, the
- various BarProp
objects, the two Storage
objects, the various
- HTMLCollection
objects, and objects defined by other specifications, like
- Selection
and the document's UndoManager
. It also includes all the Web
- IDL prototypes in the JavaScript binding, including the Document
object's
- prototype.)
Replace the Document
's singleton objects with new instances of those objects.
+ (This includes in particular the Window
, Location
,
+ History
, ApplicationCache
, and Navigator
, objects, the
+ various BarProp
objects, the two Storage
objects, the various
+ HTMLCollection
objects, and objects defined by other specifications, like
+ Selection
and the document's UndoManager
. It also includes all the Web
+ IDL prototypes in the JavaScript binding, including the Document
object's
+ prototype.)
The new Window
object has a new script settings
+ object.
Set the Document
's salvageable state back to true.
Change the document's address to the entry script's document's address.
Change the document's address to the address of the responsible document specified by + the entry script's settings object.
Let script language be JavaScript.
If method context is a Window
object, let global object be method context, let browsing context be the browsing context with which global object is associated, let document and referrer source be the Document
associated with global object, let character encoding be the character encoding of the Document
- associated with global object (this is a
- reference, not a copy), and let base URL be the base URL of the Document
associated with global object (this is a reference, not a
- copy).
Otherwise, method context is a WorkerGlobalScope
object;
- let global object, browsing context, document, referrer source, character
- encoding, and base URL be the script's global object,
- script's browsing context, script's document, script's
- referrer source, script's URL character encoding, and script's
- base URL (respectively) of the script that the
- run a worker algorithm created when it created method
- context.
Let settings object be method context's + script settings object.
Create a script using script source as the script - source, the URL where script source can be found, scripting language as the scripting language, global - object as the global object, browsing context as the browsing - context, document as the document, referrer source - as the referrer source, character encoding as the URL character - encoding, and base URL as the base URL.
+ source, the URL where script source can be found, scripting language as the scripting language, and settings + object as the script settings object.If the repeat flag is true, then call timer initialization
steps again, passing them the same method arguments, the same method
@@ -72569,7 +72654,8 @@ Resolve url relative to the
- entry script's base URL.7.5.3
If this fails, then throw a SyntaxError
exception and abort these steps.
If the active sandboxing flag set of the active document of the - browsing context of the incumbent - script has its sandboxed auxiliary navigation browsing context flag set, + responsible browsing context specified by the incumbent + script's settings object has its sandboxed auxiliary navigation browsing context flag set, then return the empty string and abort these steps.
Set all the flags in the new browsing context's popup sandboxing flag set that are set in the active sandboxing flag set of the active document of - the browsing context of the incumbent - script. The browsing context of the incumbent script + the responsible browsing context specified by the incumbent + script's settings object. The responsible browsing context specified by the incumbent script's settings object must be set as the new browsing context's one permitted sandboxed navigator.
@@ -72689,9 +72776,11 @@Navigate the new browsing context to the absolute URL that resulted from resolving - url earlier, with replacement enabled, and with the browsing context of the incumbent script + url earlier, with replacement enabled, and with the responsible + browsing context specified by the incumbent script's settings object as the source browsing context.
@@ -73152,9 +73241,10 @@%s
".
+
User agents must throw a SyntaxError
exception if resolving the url argument relative to the entry
- script's base URL, is not successful.
The resulting absolute URL would by definition not be a valid
URL as it would include the string "%s
" which is not a valid
@@ -73170,10 +73260,12 @@
The resulting absolute URL is the proto-URL. It identifies the handler for the purposes of the methods described below.
+When the user agent uses this handler, it must replace the first occurrence of the exact
literal string "%s
" in the url argument with an
escaped version of the absolute URL of the content in question (as defined below),
- then resolve the resulting URL, relative to the base URL of the entry script at the time the registerContentHandler()
or registerProtocolHandler()
methods were
+ then resolve the resulting URL, relative to the API
+ base URL specified by the entry script's settings object at the time the registerContentHandler()
or registerProtocolHandler()
methods were
invoked, and then navigate an appropriate browsing
context to the resulting URL using the GET method (or equivalent for non-HTTP URLs).
If the string does not contain the substring "%s
", abort these
steps. There's no matching handler.
Resolve the string relative to the base URL of the entry script.
Resolve the string relative to the API base URL + specified by the entry script's settings object.
If this fails, then throw a SyntaxError
exception, aborting the
method.
+
Resolve the value of the method's first argument
- relative to the entry script's base
- URL.
+ relative to the API base URL specified by the entry script's settings object.
If this fails, abort these steps.
@@ -74032,9 +74126,10 @@ 7.6.2 The Let host1 be the host component of the origin of the
entry script.
+
Resolve the scriptURL argument
- relative to the entry script's base
- URL.
+ relative to the API base URL specified by the entry script's settings
+ object.
If this fails, return 0 and abort these steps.
@@ -77969,9 +78064,9 @@ 9.2.2 The EventSourceInit
dictionary. When the
EventSource()
constructor is invoked, the UA must run these steps:
- Resolve the URL specified in the first
- argument, relative to the entry script's base
- URL.
+
Resolve the URL specified in the first
+ argument, relative to the API base URL specified by the entry script's settings
+ object.
If the previous step failed, then throw a SyntaxError
exception and abort
@@ -77990,9 +78085,10 @@
9.2.2 The
+
Do a potentially CORS-enabled fetch of the resulting absolute
- URL using the entry script's referrer
- source, with the mode being CORS mode, and the origin being the entry script's origin, and process the resource obtained in this fashion, if any, as
described below.
@@ -79609,7 +79705,7 @@ 9.4.3 Posting messages
- -
+
-
Let message clone be the result of obtaining a structured
clone of the message argument, with transfer map
@@ -79623,14 +79719,14 @@
9.4.3 Posting messages
If the method was invoked with a third argument transfer, run these
substeps:
- -
+
-
-
Let new owner be the Window
object on which the method was
+
Let new owner be the script settings object of the Window
object on which the method was
invoked.
- -
+
-
For each object x in transfer in turn, obtain a new
object y by new ports into a read only
array.
@@ -79658,9 +79754,11 @@ 9.4.3 Posting messages
-
+
If the targetOrigin argument is a single literal U+002F SOLIDUS character
(/), and the Document
of the Window
object on which the method was
- invoked does not have the same origin as the entry script's document, then abort these steps silently.
+ invoked does not have the same origin as the responsible document specified by the entry script's settings
+ object, then abort these steps silently.
Otherwise, if the targetOrigin argument is an absolute URL,
and the Document
of the Window
object on which the method was invoked
@@ -79674,12 +79772,16 @@
9.4.3 Posting messages
-
+
Create a trusted event that uses the
MessageEvent
interface, with the event type message
, which does not bubble, is not cancelable, and has no
default action. The data
attribute must be
initialized to the value of message clone, the origin
attribute must be initialized to the Unicode serialization of the
origin of the incumbent script, the source
attribute must be initialized to the
- script's global object's WindowProxy
object, and the ports
attribute must be initialized to the new ports array.
+ WindowProxy
object corresponding to the
+ global object (a Window
object) specified by the
+ incumbent script's settings object,
+ and the ports
attribute must be initialized to the new ports array.
@@ -79914,11 +80016,14 @@ 9.5.2 Message channels
When the MessageChannel()
constructor is
called, it must run the following algorithm:
- Create a new MessagePort
object owned by the script's
- global object, and let port1 be that object.
+ Create a new MessagePort
object whose owner
+ is the settings object
+ of the incumbent script, and let port1 be that object.
- Create a new MessagePort
object owned by the script's
- global object, and let port2 be that object.
+
+ Create a new MessagePort
object whose owner
+ is the settings object
+ of the incumbent script, and let port2 be that object.
Entangle the port1 and port2
objects.
@@ -80000,21 +80105,30 @@ 9.5.3 Message ports
message queue, initially empty. A port message queue can be enabled or
disabled, and is initially disabled. Once enabled, a port can never be disabled again (though
messages in the queue can get moved to another queue or removed altogether, which has much the
- same effect). A MessagePort
also has a has been shipped flag. It must
- initially be false.
+ same effect). A MessagePort
also has a has been shipped flag, which must
+ initially be false, and an owner, which is a settings
+ object set when the object is created, as described below.
+
When a port's port message queue is enabled, the event loop must use
- it as one of its task sources.
-
- If the Document
of the port's event listeners' global object is not fully active, then the messages are
+ it as one of its task sources. All tasks queued on the port
+ message queue must be associated with the responsible document specified by
+ the port's owner.
+
+
+ If the port's owner specifies a responsible document that is fully active,
+ but the event listeners all have scripts whose settings objects
+ specify responsible documents that are not fully active, then the messages will be
lost.
+
Each event loop has a task source called the unshipped port
message queue. This is a virtual task source: it must act as if it contained
the tasks of each port message queue of each
- MessagePort
whose has been shipped flag is false and whose port
- message queue is enabled, in the order in which they were added to their respective
+ MessagePort
whose has been shipped flag is false, whose port
+ message queue is enabled, and whose owner
+ specifies that event loop as the responsible event loop,
+ in the order in which they were added to their respective
task source. When a task would be removed from the
unshipped port message queue, it must instead be removed from its port message
queue.
@@ -80029,9 +80143,10 @@ 9.5.3 Message ports
is true, its port message queue acts as a first-class task source,
unaffected to any unshipped port message queue.
- When the user agent is to create a new MessagePort
object owned by a
- script's global object object owner, it must instantiate a new
- MessagePort
object, and let its owner be owner.
+
+ When the user agent is to create a new MessagePort
object with a particular
+ settings object as its owner, it must instantiate a new
+ MessagePort
object, and let its owner be owner.
When the user agent is to entangle two MessagePort
objects, it must run
the following steps:
@@ -80069,7 +80184,7 @@ 9.5.3 Message ports
Set original port's has been shipped flag to
true.
- Create a new MessagePort
object owned by owner, and let new port be that object.
+ Create a new MessagePort
object whose owner is owner, and let new port be that object.
Set new port's has been shipped flag to true.
@@ -80176,7 +80291,8 @@ 9.5.3 Message ports
-
-
Let new owner be the owner of target port, if there
+
+
Let new owner be the owner of target port, if there
is a target port, or else some arbitrary owner. (This new
owner is used when transferring objects below. If there is no target
port, the Transferable
objects given in the second argument, if any, are
@@ -80238,8 +80354,9 @@
9.5.3 Message ports
Let message be the method's first argument.
- Create a new MessagePort
object owned by the script's
- global object, and let port1 be that object.
+ Create a new MessagePort
object whose owner is the incumbent script's settings
+ object, and let port1 be that object.
If the source port is not entangled with another port, then return
port1 and abort these steps.
9.5.3 Message ports
Let target port be the port with which source port
is entangled.
- Create a new MessagePort
object owned by the owner of the target port, and let port2 be that object.
+ Create a new MessagePort
object whose owner is the owner of
+ the target port, and let port2 be that object.
Entangle the port1 and port2
objects.
@@ -80402,9 +80520,10 @@ 9.5.5 Ports and gar
+
When a MessagePort
object o is entangled, user agents must
either act as if o's entangled MessagePort
object has a strong
- reference to o, or as if o's owner has a strong reference
+ reference to o, or as if the global object specified by o's owner has a strong reference
to o.
@@ -81595,7 +81714,7 @@ if the JavaScript global environment is a shared worker
environment.
- Shared workers receive message ports through connect
events on their global object for each
+
Shared workers receive message ports through connect
events on their SharedWorkerGlobalScope
object for each
connection.
The name
attribute must return
@@ -81672,14 +81791,15 @@
10.2.3 The worker's life
it must be removed from the list of the worker's Document
s of each
worker whose list contains that Document
.
-
Given a script's global object o when creating or obtaining a
+
+
Given a settings object o when creating or obtaining a
worker, the list of relevant Document
objects to add depends on the type
- of o. If o is a WorkerGlobalScope
object
+ of global object specified by o's. If o
+ specifies a global object that is a WorkerGlobalScope
object
(i.e. if we are creating a nested worker), then the relevant Document
s are the
- Document
s that are in o's own list of the worker's
- Document
s. Otherwise, o is a Window
object,
- and the relevant Document
is just the Document
that is the active
- document of the Window
object o.
+ the worker's Document
s of the global object specified by
+ o. Otherwise, o specifies a global object that is a Window
object,
+ and the relevant Document
is just the responsible document specified by o.
A worker is said to be a permissible worker if its list of the worker's
Document
s is not empty.
@@ -81698,8 +81818,9 @@ 10.2.3 The worker's life
10.2.4 Processing model
-
When a user agent is to run a worker for a script with URL url, a browsing context owner browsing context, a
- Document
owner document, an origin owner origin, and with global scope worker global scope, it
+
+
When a user agent is to run a worker for a script with URL url, a script settings object settings object,
+ and an origin owner origin, it
must run the following steps:
-
@@ -81712,6 +81833,9 @@
10.2.4 Processing model
+ Let worker global scope be the global object specified
+ by settings object.
+
If worker global scope is actually a
SharedWorkerGlobalScope
object (i.e. the worker is a shared worker), and there are
any relevant application caches that are
@@ -81724,8 +81848,8 @@
10.2.4 Processing model
-
Attempt to fetch the resource identified by url,
- from the owner origin, using owner document as the
- referrer source, with the synchronous flag set and the force same-origin
+ from the owner origin, using the responsible document specified by settings object as the
+ referrer source (not the specified API referrer source!), with the synchronous flag set and the force same-origin
flag set.
If the attempt fails, then for each Worker
or SharedWorker
object
@@ -81745,7 +81869,7 @@
10.2.4 Processing model
In the newly created execution environment, create a JavaScript global
- environment whose global object is worker global scope. If worker global scope is a DedicatedWorkerGlobalScope
object, then this
+ environment whose global object is worker global scope. If worker global scope is a DedicatedWorkerGlobalScope
object, then this
is a dedicated worker environment. Otherwise, worker global
scope is a SharedWorkerGlobalScope
object, and this is a shared worker
environment. (In either case, by definition, it is a worker
@@ -81753,28 +81877,17 @@ 10.2.4 Processing model
-
-
A new script is now created, as follows.
+ Let script be a new script.
- Create a new script execution environment set up as appropriate for the
- scripting language language.
+ Obtain the appropriate script execution environment for the scripting language
+ language from settings object.
Parse/compile/initialize source using that script execution
environment, as appropriate for language, and thus obtain a
code entry-point.
- Set the script's global object to worker global scope.
-
- Set the script's browsing context to owner browsing
- context.
-
- Set the script's document to owner document.
-
- Set the script's referrer source to url.
-
- Set the script's URL character encoding to UTF-8. (This is just used for
- encoding non-ASCII characters in the query component of URLs.)
-
- Set the script's base URL to url.
+ Let script's settings object be settings
+ object.
@@ -81821,8 +81934,8 @@ 10.2.4 Processing model
-
-
Event loop: Create a new event
- loop, and run it until it is destroyed.
+ Event loop: Run the responsible
+ event loop specified by settings object until it is destroyed.
The handling of events or the execution of callbacks by tasks run by the event loop might get prematurely
aborted by the "kill a worker" or "terminate a worker" algorithms
@@ -81971,7 +82084,97 @@
10.2.6.1 T
Event handler Event handler event type
onerror
error
-
10.2.6.2 Dedicated workers and the Worker
interface
+ 10.2.6.2 Script settings for workers
+
+ When the user agent is required to set up a worker script settings object, given a
+ worker global scope, it must run the following steps:
+
+ Let inherited responsible browsing context be the responsible
+ browsing context specified by the incumbent script's settings
+ object.
+
+ Let inherited responsible document be the responsible
+ document specified by the incumbent script's settings
+ object.
+
+ Let worker event loop be a newly created event
+ loop.
+
+ -
+
+
Let settings object be a new script settings object whose
+ algorithms are defined as follows:
+
+ - The script execution environments
+ -
+
+
When the script settings object is created, for each language supported by the
+ user agent, create an appropriate execution environment as defined by the relevant
+ specification.
+
+ When a script execution environment is needed, return the appropriate one from
+ those created when the script settings object was created.
+
+ Currently, workers only support JavaScript, so only a JavaScript execution
+ environment is actually needed here.
+
+
+
+ - The global object
+ -
+
+
Return worker global scope.
+
+
+
+ - The responsible browsing context
+ -
+
+
Return inherited responsible browsing context.
+
+
+
+ - The responsible document
+ -
+
+
Return inherited responsible document.
+
+
+
+ - The responsible event loop
+ -
+
+
Return worker event loop.
+
+
+
+ - The API referrer source
+ -
+
+
Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The API URL character encoding
+ -
+
+
Return UTF-8.
+
+
+
+ - The API base URL
+ -
+
+
Return worker URL.
+
+
+
+
+
+ Return settings object.
+
+
10.2.6.3 Dedicated workers and the Worker
interface
[Constructor(DOMString scriptURL)]
interface Worker : EventTarget {
@@ -82027,17 +82230,21 @@ 10.2.6.1 T
the request violates a policy decision (e.g. if the user agent is configured to not allow the
page to start dedicated workers).
+
Resolve the scriptURL argument
- relative to the entry script's base URL, when
- the method is invoked.
+ relative to the API base URL specified by the entry script's settings object when
+ the method was invoked.
If this fails, throw a SyntaxError
exception and abort these steps.
+ Let worker URL be the resulting absolute URL.
+
-
-
If the scheme component of the resulting parsed
- URL is not "data
", and the origin of the
- resulting absolute URL is not the same as the
+
+
If the scheme component of worker URL
+ is not "data
", and the origin of worker URL
+ is not the same as the
origin of the entry script, then throw a SecurityError
exception and
abort these steps.
@@ -82052,16 +82259,22 @@ 10.2.6.1 T
origin is the origin of the entry script. Let worker global
scope be this new object.
+ Set up a worker script settings object with worker global
+ scope, and let settings object be the result.
+
Create a new Worker
object, associated with worker global
scope. Let worker be this new object.
- Create a new MessagePort
object owned by the global object of the incumbent script. Let
+
+
Create a new MessagePort
object whose owner
+ is the settings object of the incumbent script. Let
this be the outside port.
Associate the outside port with worker.
- Create a new MessagePort
object owned by worker
- global scope. Let inside port be this new object.
+
+ Create a new MessagePort
object whose owner is script settings
+ Let inside port be this new object.
Associate inside port with worker global
scope.
@@ -82079,8 +82292,9 @@ 10.2.6.1 T
-
+
Let docs be the list of relevant Document
objects to
- add given the global object of the
+ add given the settings object of the
incumbent script.
@@ -82095,25 +82309,24 @@ 10.2.6.1 T
-
-
If the global object of the incumbent
- script is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
+
+
If the global object specified by the incumbent
+ script's settings object is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
add worker global scope to the list of the worker's workers of
- the WorkerGlobalScope
object that is the global object of the incumbent script.
+ the WorkerGlobalScope
object that is the global object of the incumbent script's settings object.
-
-
Run a worker for the resulting absolute URL, with the
- script's browsing context of the incumbent script as the owner browsing context, with the script's document of the
- incumbent script as the owner document, with the
- origin of the entry script as the owner origin,
- and with worker global scope as the global scope.
+ Run a worker for the script with URL worker
+ URL, the script settings object settings object, and the
+ origin of the entry script as the owner
+ origin.
-
10.2.6.3 Shared workers and the SharedWorker
interface
+ 10.2.6.4 Shared workers and the SharedWorker
interface
[Constructor(DOMString scriptURL, optional DOMString name)]
interface SharedWorker : EventTarget {
@@ -82160,7 +82373,7 @@ 10.2.6.1 T
-
Let docs be the list of relevant Document
objects to
- add given the global object of the
+ add given the settings object of the
incumbent script.
@@ -82172,7 +82385,9 @@ 10.2.6.1 T
Create a new SharedWorker
object, which will shortly be associated with a
SharedWorkerGlobalScope
object. Let this SharedWorker
object be worker.
- Create a new MessagePort
object owned by the global object of the incumbent script. Let
+
+
Create a new MessagePort
object whose owner
+ is the settings object of the incumbent script. Let
this be the outside port.
Assign outside port to the port
attribute of worker.
@@ -82217,7 +82432,12 @@ 10.2.6.1 T
Associate worker with worker global
scope.
- Create a new MessagePort
object owned by worker global scope. Let this be the inside port.
+ Let settings object be the script settings object
+ whose global object is worker global scope.
+
+
+ Create a new MessagePort
object whose owner
+ is settings object. Let this be the inside port.
Entangle outside port
and inside port.
@@ -82241,11 +82461,12 @@ 10.2.6.1 T
-
-
If the global object of the incumbent
- script is a WorkerGlobalScope
object, add worker global
+
+ If the global object specified by the incumbent
+ script's settings object is a WorkerGlobalScope
object, add worker global
scope to the list of the worker's workers of the
- WorkerGlobalScope
object that is the global object of the incumbent script.
+ WorkerGlobalScope
object that is the global
+ object specified by the incumbent script's settings object.
@@ -82253,17 +82474,23 @@ 10.2.6.1 T
+
+
Create a new SharedWorkerGlobalScope
object whose worker
origin is the origin of the entry script. Let worker global
scope be this new object.
+ Set up a worker script settings object with worker global
+ scope, and let settings object be the result.
+
Associate worker with worker global
scope.
Set the name
attribute of worker global scope to name.
- Create a new MessagePort
object owned by worker
- global scope. Let inside port be this new object.
+
+ Create a new MessagePort
object whose owner is settings object.
+ Let inside port be this new object.
Entangle outside port and inside
port.
@@ -82291,21 +82518,18 @@ 10.2.6.1 T
-
-
If the global object of the incumbent
- script that invoked the constructor is a WorkerGlobalScope
object, add worker global scope to the list of the worker's workers of the
- WorkerGlobalScope
object that is the global
- object of the incumbent script.
+
+ If the global object specified by the settings object of the incumbent
+ script is a WorkerGlobalScope
object, add worker global scope to the list of the worker's workers of the
+ WorkerGlobalScope
object that is the global
+ object specified by the incumbent script's settings object.
-
-
Run a worker for scriptURL, with the script's browsing
- context of the incumbent script as the owner browsing
- context, with the script's document of the incumbent script the
- owner document, with the origin of the entry
- script as the owner origin, and with worker global
- scope as the global scope.
+ Run a worker for the script with URL scriptURL, the script settings object settings
+ object, and the origin of the entry script as the owner origin.
@@ -82336,15 +82560,19 @@ 10.3.1 Importing
If there are no arguments, return without doing anything. Abort these steps.
+ Let settings object be the script settings object of the
+ incumbent script.
+
Resolve each argument.
If any fail, throw a SyntaxError
exception and abort these steps.
-
+
Attempt to fetch each resource identified by the resulting absolute URLs, from the entry script's
- origin, using the entry script's referrer source, and with the synchronous flag set.
@@ -82373,14 +82601,13 @@ 10.3.1 Importing
-
-
Create a script, using source as the script source, the
- URL from which source was obtained, and language as the scripting language, using the same global object, browsing
- context, document, referrer source, URL character encoding, and base URL as the script that was created by the worker's run a
- worker algorithm.
+ Create a script using source as the script source, the
+ URL from which source was obtained, language as the scripting language, and settings object as
+ the script settings object.
If the script came from a resource whose URL does not have the same
origin as the worker origin, then pass the muted
- errors flag to the create a script from a node algorithm.
+ errors flag to the create a script algorithm as well.
Let the newly created script run until it either
returns, fails to parse, fails to catch an exception, or gets prematurely aborted by the
@@ -94972,7 +95199,7 @@
14.9 Unstyled XML documen
- None of the elements in the
Document
are in any of the following namespaces: HTML namespace, SVG namespace, MathML namespace
- The
Document
has no focusable elements (e.g. from XLink).
- The
Document
has no hyperlinks (e.g. from XLink).
- - There exists no script whose document is this
Document
.
+ - There exists no script whose settings object specifies this
Document
as the responsible document.
- None of the elements in the
Document
have any registered event listeners.
An unstyled document view is one where the DOM is not rendered according to CSS
(which would, since there are no applicable styles in this context, just result in a wall of
diff --git a/index b/index
index b0bd39cc059..fd082f1c973 100644
--- a/index
+++ b/index
@@ -298,7 +298,7 @@
HTML
- Living Standard — Last Updated 28 October 2013
+ Living Standard — Last Updated 30 October 2013
- Web developer edition:
- http://developers.whatwg.org/
- Multiple-page version:
@@ -1010,13 +1010,14 @@
- 7.1.3 Processing model
+ - 7.1.3.6.1 Runtime script errors in documents
+ - 7.1.3.6.2 The
ErrorEvent
interface
- 7.1.4 Event loops
+ - 10.2.6.2 Script settings for workers
+ - 10.2.6.3 Dedicated workers and the
Worker
interface
+ - 10.2.6.4 Shared workers and the
SharedWorker
interface
- 10.3 APIs available to workers
- 10.3.1 Importing scripts and libraries
@@ -6681,7 +6683,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
- If the URL came from a script (e.g. as an argument to a method)
- - The URL character encoding is the script's URL character encoding.
+
+ - The URL character encoding is the API URL character encoding specified by the script's settings object.
- If the URL came from a DOM node (e.g. from an element)
@@ -8387,10 +8390,12 @@ interface Transferable { };
their user interface. This is the primary mechanism by which a user can tell if a site is
attempting to impersonate another.
+
When a Document
is created by a script using
the createDocument()
or createHTMLDocument()
APIs, the
- document's address is the same as the document's address of the script's
- document, and the Document
is both ready for post-load tasks and
+ document's address is the same as the document's address of the responsible
+ document specified by the script's settings
+ object, and the Document
is both ready for post-load tasks and
completely loaded immediately.
The document's referrer is an absolute URL that can be set when the
@@ -8820,6 +8825,8 @@ partial /*sealed*/ interface Document {
+
+
@@ -9086,8 +9093,10 @@ partial /*sealed*/ interface Document {
-->Let document be the XMLDocument
object on which the
method was invoked.
+
Resolve the method's first argument, relative to the
- entry script's base URL. If this is not
+ API base URL specified by the
+ entry script's settings object. If this is not
successful, throw a SyntaxError
exception and abort these steps. Otherwise, let url be the resulting absolute URL.
If the origin of url is not the same as the
@@ -9112,9 +9121,10 @@ partial /*sealed*/ interface Document {
Let success be false.
+
Fetch url from the origin of
- document, using the entry script's referrer source, with the synchronous flag set and the force same-origin flag set.
+ document, using the API referrer source specified by the entry script's
+ settings object, with the synchronous flag set and the force same-origin flag set.
-
@@ -51847,29 +51857,33 @@ dictionary RelatedEventInit :
-
+
Let old script element be the value to which the
- Document
element's currentScript
object was most recently
+ script
element's Document
's currentScript
object was most recently
initialized.
-
-
Initialize the Document
element's currentScript
object to the script
+
+
Initialize the script
element's Document
's currentScript
object to the script
element.
-
-
Create a script from the
- script
element node, using the script block's source, the
- URL from which the script was obtained, and the script block's
- type.
+
+ Create a script, using the script block's source, the
+ URL from which the script was obtained, the script block's
+ type as the scripting language, and the script settings object of the script
element's
+ Document
's Window
object.
+
If the script came from a resource that was fetched in the
- steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script from a node
- algorithm.
+ steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script
+ algorithm as well.
This is where the script is compiled and actually executed.
@@ -51877,7 +51891,8 @@ dictionary RelatedEventInit :
-
-
Initialize the Document
element's currentScript
object to old script
+
+ Initialize the script
element's Document
's currentScript
object to old script
element.
@@ -64264,12 +64279,14 @@ END:VCARD
present, and as if all the properties of that Window
object had their [[Enumerable]]
attribute set to false.
+
For members that return objects (including function objects), each distinct effective
script origin that is not the same as the Window
object's
Document
's effective script origin must be provided with a separate set
of objects. These objects must have the prototype chain appropriate for the script for which the
- objects are created (not those that would be appropriate for scripts whose script's global
- object is the Window
object in question).
+ objects are created (not those that would be appropriate for scripts whose global
+ object, as specified by their settings object,
+ is the Window
object in question).
@@ -64341,11 +64358,12 @@ END:VCARD
The method has four arguments, though they are all optional.
+
The first argument, url, must be a valid non-empty URL for a
page to load in the browsing context. If the first argument is the empty string, then the url argument must be interpreted as "about:blank
". Otherwise, the
argument must be resolved to an absolute URL (or
- an error), relative to the entry script's base
- URL, when the method is invoked.
+ an error), relative to the API base URL specified by the entry script's settings
+ object when the method was invoked.
The second argument, target, specifies the name of the browsing context that is to be navigated. It must be a valid
@@ -64378,13 +64396,14 @@ END:VCARD
browsing context, then throw an InvalidAccessError
exception and abort these
steps.
+
Otherwise, if url is not "about:blank
", the user agent must
navigate the selected browsing context to the
absolute URL obtained from resolving url earlier. If the replace is true or if the browsing
context was just created as part of the rules for choosing a browsing context given a
browsing context name, then replacement must be
- enabled. The navigation must be done with the browsing context of the incumbent script as the source browsing
+ enabled. The navigation must be done with the responsible
+ browsing context specified by the incumbent script's settings object as the source browsing
context. If the resolve a URL algorithm failed, then the user agent may either
instead navigate to an inline error page, using the same replacement behavior and
source browsing context behavior as described earlier in this paragraph; or treat the url as "about:blank
", acting as described in the next paragraph.
@@ -64415,11 +64434,15 @@ END:VCARD
- The corresponding browsing context A is
script-closable.
- - The browsing context of the incumbent
- script is familiar with the browsing context A.
+
+ - The responsible browsing context specified by the incumbent
+ script's settings object is familiar
+ with the browsing context A.
- - The browsing context of the
- incumbent script is allowed to navigate the browsing
+
+
- The responsible browsing context specified by the
+ incumbent script's settings object
+ is allowed to navigate the browsing
context A.
A browsing context is script-closable if it is an auxiliary
@@ -64462,13 +64485,15 @@ END:VCARD
+
The length
IDL attribute on the Window
interface must return the number of child browsing
contexts that are nested through
elements that are in the Document
that is the
active document of that Window
object, if that Window
's
- browsing context shares the same event loop as the script's
- browsing context of the entry script accessing the IDL attribute; otherwise,
+ browsing context shares the same event loop as the responsible
+ document specified by the settings object of the
+ entry script accessing the IDL attribute; otherwise,
it must return zero.
@@ -64585,8 +64610,10 @@ END:VCARD
objects have implied strong references to the
WindowProxy
object.
- Each script has a strong reference to its browsing context and its document.
+
+ Each script has a strong reference to its settings
+ object, and each script settings object
+ has strong references to its global object, responsible browsing context, and responsible document.
When a browsing context is to discard a Document
, the user
@@ -65921,8 +65948,9 @@ x === this; // true
If the third argument is not null, run these substeps:
- - Resolve the value of the third argument, relative to the
- entry script's base URL.
+ - Resolve the value of the third argument, relative to the
+ API base URL specified by the
+ entry script's settings object.
- If that fails, throw a
SecurityError
exception and abort these steps.
@@ -65932,9 +65960,10 @@ x === this; // true
query, and fragment components, then throw a
SecurityError
exception and abort these steps.
+
- If the origin of the resulting absolute URL is not the same as
- the origin of the entry script's document, and either the path or query components of the two parsed
+ the origin of the responsible document specified by the entry script's
+ settings object, and either the path or query components of the two parsed
URLs compared in the previous step differ, throw a
SecurityError
exception
and abort these steps. (This prevents sandboxed content from spoofing other pages on the same
origin.)
@@ -66189,9 +66218,10 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BU
The relevant Document
is the Location
object's associated
Document
object's browsing context's active document.
+
When the assign(url)
method is invoked, the UA must resolve the argument, relative
- to the entry script's base URL, and if that is
+ to the API base URL specified by the entry script's settings object, and if that is
successful, must navigate the browsing
context to the specified url. If the browsing context's
session history contains only one Document
, and that was the
@@ -66201,14 +66231,16 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BU
Safari doesn't check that. Thus this might need changing if testing shows the IE/Firefox behaviour
is required here. -->
+
When the replace(url)
method is invoked, the UA must resolve the argument, relative
- to the entry script's base URL, and if that is
+ to the API base URL specified by the entry script's settings object, and if that is
successful, navigate the browsing
context to the specified url with replacement enabled.
- Navigation for the assign()
and replace()
methods must be done with the browsing context of the incumbent script as the source
+
+ Navigation for the assign()
and replace()
methods must be done with the responsible browsing context specified by
+ the incumbent script's settings object as the source
browsing context.
If the resolving step of the assign()
and replace()
methods is not successful, then the user agent must
@@ -66272,9 +66304,10 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BU
input
algorithm with the address of the
relevant Document
as the given value.
+
The element's URLUtils
interface's get the
- base algorithm must return the entry script's base URL, if there is one, or null otherwise.
+ base algorithm must return the API base URL specified by the entry script's
+ settings object, if there is one, or null otherwise.
The element's URLUtils
interface's query
encoding is the document's character encoding.
@@ -66326,12 +66359,15 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BU
context's active document's effective script origin, with the
following exceptions:
- - The
href
setter, if the entry script's
- script's browsing context is familiar with the browsing
+ - The
href
setter, if the responsible browsing context
+ specified by the entry script's
+ settings object is familiar with the browsing
context with which the Location
object is associated
- - The
replace()
method, if the entry
- script's script's browsing context is familiar with the
+
+ - The
replace()
method, if the responsible
+ browsing context specified by the entry script's
+ settings object is familiar with the
browsing context with which the Location
object is associated
- Any properties not defined in the IDL for the
Location
object or indirectly via
@@ -66345,12 +66381,13 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BU
properties, getters, setters, etc, were not present, and as if all the properties of that
Location
object had their [[Enumerable]] attribute set to false.
+
For members that return objects (including function objects), each distinct effective
script origin that is not the same origin as the Location
object's Document
's effective script origin must be provided with a
separate set of objects. These objects must have the prototype chain appropriate for the script
for which the objects are created (not those that would be appropriate for scripts whose
- script's global object is the Location
object's Document
's
+ settings object specifies a global object that is the Location
object's Document
's
Window
object).
@@ -67757,7 +67794,7 @@ dictionary PageTransitionEventInit : -
-
Make disappear any WebSocket
objects that were created by the WebSocket()
constructor whose global object is the
+
Make disappear any WebSocket
objects that were created by the WebSocket()
constructor from the
Document
's Window
object.
If this affected any WebSocket
objects, then set Document
's salvageable state to false.
@@ -69915,26 +69952,27 @@ interface NavigatorOnLine {
information).
-
- - A script execution environment
+
+
+
A script settings object specifies algorithms for obtaining the following:
+
+ - A script execution environment for each language supported by the user agent
-
@@ -69947,19 +69985,18 @@ interface NavigatorOnLine {
- - A relationship with the script's global object
-
+ - A global object
-
-
An object that provides the APIs that the code can use.
-
- This is typically a Window
object. In JavaScript, this
- corresponds to the global object.
+ An object that provides the APIs that can be called by the code in scripts that use this
+ settings object.
- When a script's global object is an empty object, it can't do
- anything that interacts with the environment.
+ This is typically a Window
object or a
+ WorkerGlobalScope
object. When a global object is an empty object, it
+ can't do anything that interacts with the environment.
- If the script's global object is a Window
object, then in
+
+
If the global object is a Window
object, then, in
JavaScript, the ThisBinding of the global execution context for this script must be the
Window
object's WindowProxy
object, rather than the global object. [ECMA262]
@@ -69970,69 +70007,147 @@ interface NavigatorOnLine {
- - A relationship with the script's browsing context
+ - A responsible browsing context
-
A browsing context that is assigned responsibility for actions taken by the
- script.
+ scripts that use this script settings object.
When a script creates and navigates a new
- top-level browsing context, the opener
attribute of
- the new browsing context's Window
object will be set to the
- script's browsing context's WindowProxy
object.
+ top-level browsing context, the opener
attribute
+ of the new browsing context's Window
object will be set to the
+ responsible browsing context's WindowProxy
object.
- - A relationship with the script's document
+ - A responsible document
-
-
A Document
that is assigned responsibility for actions taken by the script.
+ A Document
that is assigned responsibility for actions taken by the scripts that
+ use this script settings object.
+
For example, the address of the
- script's document is used to set the address of any Document
elements created using createDocument()
.
+ responsible document is used to set the address of any Document
s created using createDocument()
.
+
+
+
+ - A responsible event loop
+
+ -
+
+
An event loop that is used when it would not be immediately clear what event
+ loop to use.
- - The script's referrer source
+ - An API referrer source
-
-
Either a Document
(specifically, the script's document), or a
+
Either a Document
(specifically, the responsible document), or a
URL, which is used by some APIs to determine what value to use for the Referer
(sic) header in calls to the fetching algorithm.
- - A URL character encoding
+ - An API URL character encoding
-
-
A character encoding, set when the script is created, used to encode URLs. If the character encoding is set from another source, e.g. a
- document's character encoding, then the script's URL character
- encoding must follow the source, so that if the source's changes, so does the
- script's.
+
+ A character encoding used to encode URLs by APIs called by scripts that use
+ this script settings object.
- - A base URL
+ - An API base URL
-
-
A URL, set when the script is created, used to resolve relative URLs. If the base URL is set from another
- source, e.g. a document base URL, then the script's base URL must
- follow the source, so that if the source's changes, so does the script's.
+
+ An absolute URL used by APIs called by scripts that use
+ this script settings object to resolve relative URLs.
-
+ 7.1.3.2 Script settings for browsing contexts
+ Whenever a new Window
object is created, it must also create a script
+ settings object whose algorithms are defined as follows:
-
+ - The script execution environments
+ -
+
+
When the script settings object is created, for each language supported by the
+ user agent, create an appropriate execution environment as defined by the relevant
+ specification.
+
+ When a script execution environment is needed, return the appropriate one from
+ those created when the script settings object was created.
+
+
+
+ - The global object
+ -
+
+
Return the Window
object itself.
+
+
+
+ - The responsible browsing context
+ -
+
+
Return the browsing context with which the Window
object is
+ associated.
+
+
+
+ - The responsible document
+ -
-
7.1.3.2 Calling scripts
+ Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The responsible event loop
+ -
+
+
Return the event loop that is associated with the unit of related
+ similar-origin browsing contexts to which the Window
object's browsing
+ context belongs.
+
+
+
+ - The API referrer source
+ -
+
+
Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The API URL character encoding
+ -
+
+
Return the current character encoding of
+ the Document
with which the Window
is currently associated.
+
+
+
+ - The API base URL
+ -
+
+
Return the current base URL of the
+ Document
with which the Window
is currently associated.
+
+
+
+
7.1.3.3 Calling scripts
Each unit of related similar-origin browsing contexts has a stack of
incumbent scripts, which must be initially empty. When a new script is pushed onto
@@ -70048,8 +70163,10 @@ interface NavigatorOnLine {
new incumbent script and the owner script. If this returns "do not run" then abort these
steps.
-
Make the script execution environment
- for s execute the script's code
+
+ Make the appropriate script execution environment
+ specified by s's settings
+ object execute the script's code
entry-point.
@@ -70059,11 +70176,12 @@ interface NavigatorOnLine {
script o, and return either "run" or "do
not run".
- If the global object of o
+
If the global object specified by o's settings object
is a Window
object whose Document
object is not fully
active, then return "do not run" and abort these steps.
- If scripting is disabled for o's browsing context, then return
+
+
If scripting is disabled for the responsible browsing context specified by o's settings object, then return
"do not run" and abort these steps.
Push s onto the stack of incumbent scripts, and label it
@@ -70102,7 +70220,7 @@ interface NavigatorOnLine {
The entry script is the most-recently added script in the stack of incumbent scripts that is
labeled as a candidate entry script. If the stack is
empty, or has no entries labeled as such, then there is no entry script. It is used
- to obtain, amongst other things, the script's base URL to resolve relative URLs used in scripts running in that
unit of related similar-origin browsing contexts.
@@ -70134,12 +70252,11 @@ interface NavigatorOnLine {
- 7.1.3.3 Creating scripts
+ 7.1.3.4 Creating scripts
When the specification says that a script is to be created, given some script source, a script source URL, its
- scripting language, a global object, a browsing context, a document, a referrer source, a URL
- character encoding, a base URL, and optionally a muted errors flag, the user
- agent must run the following steps:
+ scripting language, a script settings object, and optionally a muted
+ errors flag, the user agent must run the following steps:
Let script be a new script that
this algorithm will subsequently initialize.
@@ -70148,16 +70265,14 @@ interface NavigatorOnLine {
context passed to this algorithm, then abort these steps, as if the script source
described a program that did nothing but return void.
- Set up a script execution environment as appropriate for the given scripting
- language.
+ Obtain the appropriate script execution environment for the given scripting
+ language from the script settings object provided.
Parse/compile/initialize the source of the script using the script execution
environment, as appropriate for the scripting language, and thus obtain script's code entry-point.
- Set up the script's global object, the script's browsing
- context, the script's document, the script's referrer source,
- the script's URL character encoding, and the script's base URL from the
- settings passed to this algorithm.
+ Let script's settings object be the script
+ settings object provided.
If the muted errors flag was set, then set script's muted errors flag.
@@ -70167,45 +70282,20 @@ interface NavigatorOnLine {
Jump to script's code
entry-point.
+
Otherwise, report the error for script, with the problematic
- position (line number and column number), using the script's global object as the
+ position (line number and column number), using the global object specified by the script settings object as the
target. If the error is still not handled after this,
then the error may be reported to the user.
-
When the specification says that a script is to be created from a node node, given some
- script source, its URL, its scripting language, and optionally a muted errors
- flag, the user agent must create a script, using the given script source, URL, and
- scripting language, the script settings determined from the node node, and, if the muted errors flag was set in the call to this
- algorithm, the muted errors flag.
-
- The script settings determined from the node node are computed
- as follows:
-
- Let document be the Document
of node
- (or node itself if it is a Document
).
-
- The global object is the Window
object of document.
-
- The browsing context is the browsing context of document.
-
- The document is document.
-
- The referrer source is document.
-
- The URL character encoding is the character
- encoding of document. (This is a reference,
- not a copy.)
-
- The base URL is the base URL of document. (This is a reference, not a copy.)
-
- 7.1.3.4 Killing scripts
+ 7.1.3.5 Killing scripts
User agents may impose resource limitations on scripts, for example CPU quotas, memory limits,
total execution time limits, or bandwidth limitations. When a script exceeds a limit, the user
@@ -70241,7 +70331,7 @@ interface NavigatorOnLine {
- 7.1.3.5 Runtime script errors
+ 7.1.3.6 Runtime script errors
When the user agent is required to report an error for a
particular script script with a particular
@@ -70314,11 +70404,12 @@ interface NavigatorOnLine {
If event was canceled, then the error is handled. Otherwise, the error is not handled.
- 7.1.3.5.1 Runtime script errors in documents
+ 7.1.3.6.1 Runtime script errors in documents
+
Whenever an uncaught runtime script error occurs in one of the scripts associated with a
Document
, the user agent must report the error for the relevant script, with the problematic position (line number and column
- number) in the resource containing the script, using the script's global object as
+ number) in the resource containing the script, using the global object specified by the script's settings object as
the target. If the error is still not handled after this,
then the error may be reported to the user.
@@ -70326,7 +70417,7 @@ interface NavigatorOnLine {
- 7.1.3.5.2 The ErrorEvent
interface
+ 7.1.3.6.2 The ErrorEvent
interface
[Constructor(DOMString type, optional ErrorEventInit eventInitDict)]
interface ErrorEvent : Event {
@@ -70437,7 +70528,7 @@ dictionary ErrorEventInit : Even
the task was queued in the context of a browsing context, then it is the
browsing context's active document at the time the task was queued; if
the task was queued by or for a script then the document is
- the script's document.
+ the responsible document specified by the script's settings object.
A task is intended for a specific event loop:
the event loop that is handling tasks for the task's associated Document
.
@@ -70529,9 +70620,10 @@ dictionary ErrorEventInit : Even
-
+
Invoke MutationObserver
objects for the
- unit of related similar-origin browsing contexts to which the script's
- browsing context belongs, using the task wrapper algorithm as the steps to
+ unit of related similar-origin browsing contexts to which the responsible
+ browsing context specified by the script's settings object belongs, using the task wrapper algorithm as the steps to
invoke each callback.
This will typically invoke scripted callbacks, which calls the jump to a
@@ -70716,10 +70808,10 @@ dictionary ErrorEventInit : Even
context being navigated has a creator browsing context, then let address be the address of the
creator Document
instead.
- Create a script from the
- Document
node of the active document, using the aforementioned
- script source, the URL of the resource where the javascript:
URL,
- was found, and assuming the scripting language is JavaScript.
+ Create a script, using the aforementioned script source, the URL
+ of the resource where the javascript:
URL, was found, JavaScript as the scripting
+ language, and the script settings object of the Window
object of the
+ active document.
Let result be the return value of the code entry-point
of this script. If an exception was thrown, let result be void instead. (The result will be void also if scripting is disabled.)
@@ -70846,7 +70938,11 @@ dictionary ErrorEventInit : Even
Set the corresponding event handler to null.
- Set up a script execution environment for JavaScript.
+ Let script settings be the script settings object of the
+ Window
object associated with the browsing context to which belongs the
+ Document
of the element in question.
+
+ Obtain the script execution environment for JavaScript from script settings.
Let body be the event
handler content attribute's new value.
@@ -70890,7 +70986,8 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
-
-
Using the script execution environment created above, create a function object (as defined in
+
+
Using the script execution environment obtained above, create a function object (as defined in
ECMAScript edition 5 section 13.2 Creating Function Objects), with:
- Parameter list FormalParameterList
@@ -70939,15 +71036,12 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
- The value of strict.
-
Let this new function be the script's code entry-point.
+ Let this new function be a new script's code entry-point.
- Set up the script's global object, the script's browsing
- context, the script's document, the script's referrer source,
- the script's URL character encoding, and the script's base URL from
- the script settings determined from the node on which the attribute is being
- set.
+ Let that script's settings object be
+ script settings.
Set the corresponding event handler to the
aforementioned function.
@@ -71745,14 +71839,21 @@ interface WindowBase64 {
Remove all child nodes of the document, without firing any mutation events.
- Replace the Document
's singleton objects with new instances of those objects.
- (This includes in particular the Window
, Location
,
- History
, ApplicationCache
, and Navigator
, objects, the
- various BarProp
objects, the two Storage
objects, the various
- HTMLCollection
objects, and objects defined by other specifications, like
- Selection
and the document's UndoManager
. It also includes all the Web
- IDL prototypes in the JavaScript binding, including the Document
object's
- prototype.)
+ -
+
+
Replace the Document
's singleton objects with new instances of those objects.
+ (This includes in particular the Window
, Location
,
+ History
, ApplicationCache
, and Navigator
, objects, the
+ various BarProp
objects, the two Storage
objects, the various
+ HTMLCollection
objects, and objects defined by other specifications, like
+ Selection
and the document's UndoManager
. It also includes all the Web
+ IDL prototypes in the JavaScript binding, including the Document
object's
+ prototype.)
+
+ The new Window
object has a new script settings
+ object.
+
+
@@ -71765,8 +71866,10 @@ interface WindowBase64 {
Set the Document
's salvageable state back to true.
- Change the document's address to the entry script's document's address.
+
+ Change the document's address to the address of the responsible document specified by
+ the entry script's settings object.
@@ -72197,32 +72300,14 @@ interface WindowTimers {
Let script language be JavaScript.
- -
-
-
If method context is a Window
object, let global object be method context, let browsing context be the browsing context with which global object is associated, let document and referrer source be the Document
associated with global object, let character encoding be the character encoding of the Document
- associated with global object (this is a
- reference, not a copy), and let base URL be the base URL of the Document
associated with global object (this is a reference, not a
- copy).
-
- Otherwise, method context is a WorkerGlobalScope
object;
- let global object, browsing context, document, referrer source, character
- encoding, and base URL be the script's global object,
- script's browsing context, script's document, script's
- referrer source, script's URL character encoding, and script's
- base URL (respectively) of the script that the
- run a worker algorithm created when it created method
- context.
-
-
+ Let settings object be method context's
+ script settings object.
- -
+
-
Create a script using script source as the script
- source, the URL where script source can be found, scripting language as the scripting language, global
- object as the global object, browsing context as the browsing
- context, document as the document, referrer source
- as the referrer source, character encoding as the URL character
- encoding, and base URL as the base URL.
+ source, the URL where script source can be found, scripting language as the scripting language, and settings
+ object as the script settings object.
@@ -72230,7 +72315,7 @@ interface WindowTimers {
- -
+
-
If the repeat flag is true, then call timer initialization
steps again, passing them the same method arguments, the same method
@@ -72569,7 +72654,8 @@ scheduleWork(); // queues a task to do lots of work
-
Resolve url relative to the
- entry script's base URL.
+ API base URL specified by
+ entry script's settings object.
If this fails, then throw a SyntaxError
exception and abort these steps.
@@ -72598,9 +72684,10 @@ scheduleWork(); // queues a task to do lots of work
-
+
If the active sandboxing flag set of the active document of the
- browsing context of the incumbent
- script has its sandboxed auxiliary navigation browsing context flag set,
+ responsible browsing context specified by the incumbent
+ script's settings object has its sandboxed auxiliary navigation browsing context flag set,
then return the empty string and abort these steps.
@@ -72653,11 +72740,11 @@ scheduleWork(); // queues a task to do lots of work
-
+
Set all the flags in the new browsing context's popup sandboxing flag set that
are set in the active sandboxing flag set of the active document of
- the browsing context of the incumbent
- script. The browsing context of the incumbent script
+ the responsible browsing context specified by the incumbent
+ script's settings object. The responsible browsing context specified by the incumbent script's settings object
must be set as the new browsing context's one permitted sandboxed
navigator.
@@ -72689,9 +72776,11 @@ scheduleWork(); // queues a task to do lots of work
-
+
Navigate the new browsing context to
the absolute URL that resulted from resolving
- url earlier, with replacement enabled, and with the browsing context of the incumbent script
+ url earlier, with replacement enabled, and with the responsible
+ browsing context specified by the incumbent script's settings object
as the source browsing context.
@@ -73152,9 +73241,10 @@ interface NavigatorContentUtils {
argument passed to one of these methods does not contain the exact literal string
"%s
".
+
User agents must throw a SyntaxError
exception if resolving the url argument relative to the entry
- script's base URL, is not successful.
+ url">resolving the url argument relative to the
+ API base URL specified by the entry script's settings object is not successful.
The resulting absolute URL would by definition not be a valid
URL as it would include the string "%s
" which is not a valid
@@ -73170,10 +73260,12 @@ interface NavigatorContentUtils {
The resulting absolute URL is the proto-URL. It identifies the
handler for the purposes of the methods described below.
+
When the user agent uses this handler, it must replace the first occurrence of the exact
literal string "%s
" in the url argument with an
escaped version of the absolute URL of the content in question (as defined below),
- then resolve the resulting URL, relative to the base URL of the entry script at the time the registerContentHandler()
or registerProtocolHandler()
methods were
+ then resolve the resulting URL, relative to the API
+ base URL specified by the entry script's settings object at the time the registerContentHandler()
or registerProtocolHandler()
methods were
invoked, and then navigate an appropriate browsing
context to the resulting URL using the GET method (or equivalent for non-HTTP URLs).
@@ -73381,7 +73473,9 @@ interface NavigatorContentUtils {
If the string does not contain the substring "%s
", abort these
steps. There's no matching handler.
- Resolve the string relative to the base URL of the entry script.
+
+ Resolve the string relative to the API base URL
+ specified by the entry script's settings object.
If this fails, then throw a SyntaxError
exception, aborting the
method.
@@ -74008,9 +74102,9 @@ interface MimeType {
never does anything, or may arbitrarily ignore invocations with particular arguments for
security, privacy, or usability reasons.
+
Resolve the value of the method's first argument
- relative to the entry script's base
- URL.
+ relative to the API base URL specified by the entry script's settings object.
If this fails, abort these steps.
@@ -74032,9 +74126,10 @@ interface MimeType {
Let host1 be the host component of the origin of the
entry script.
+
Resolve the scriptURL argument
- relative to the entry script's base
- URL.
+ relative to the API base URL specified by the entry script's settings
+ object.
If this fails, return 0 and abort these steps.
@@ -77969,9 +78064,9 @@ dictionary EventSourceInit {
settings, if any, in the form of an EventSourceInit
dictionary. When the
EventSource()
constructor is invoked, the UA must run these steps:
- Resolve the URL specified in the first
- argument, relative to the entry script's base
- URL.
+
Resolve the URL specified in the first
+ argument, relative to the API base URL specified by the entry script's settings
+ object.
If the previous step failed, then throw a SyntaxError
exception and abort
@@ -77990,9 +78085,10 @@ dictionary EventSourceInit {
-
+
Do a potentially CORS-enabled fetch of the resulting absolute
- URL using the entry script's referrer
- source, with the mode being CORS mode, and the origin being the entry script's origin, and process the resource obtained in this fashion, if any, as
described below.
@@ -79609,7 +79705,7 @@ function receiver(e) {
- -
+
-
Let message clone be the result of obtaining a structured
clone of the message argument, with transfer map
@@ -79623,14 +79719,14 @@ function receiver(e) {
If the method was invoked with a third argument transfer, run these
substeps:
- -
+
-
-
Let new owner be the Window
object on which the method was
+
Let new owner be the script settings object of the Window
object on which the method was
invoked.
- -
+
-
For each object x in transfer in turn, obtain a new
object y by new ports into a read only
array.
@@ -79658,9 +79754,11 @@ function receiver(e) {
-
+
If the targetOrigin argument is a single literal U+002F SOLIDUS character
(/), and the Document
of the Window
object on which the method was
- invoked does not have the same origin as the entry script's document, then abort these steps silently.
+ invoked does not have the same origin as the responsible document specified by the entry script's settings
+ object, then abort these steps silently.
Otherwise, if the targetOrigin argument is an absolute URL,
and the Document
of the Window
object on which the method was invoked
@@ -79674,12 +79772,16 @@ function receiver(e) {
-
+
Create a trusted event that uses the
MessageEvent
interface, with the event type message
, which does not bubble, is not cancelable, and has no
default action. The data
attribute must be
initialized to the value of message clone, the origin
attribute must be initialized to the Unicode serialization of the
origin of the incumbent script, the source
attribute must be initialized to the
- script's global object's WindowProxy
object, and the ports
attribute must be initialized to the new ports array.
+ WindowProxy
object corresponding to the
+ global object (a Window
object) specified by the
+ incumbent script's settings object,
+ and the ports
attribute must be initialized to the new ports array.
@@ -79914,11 +80016,14 @@ interface MessageChannel {
When the MessageChannel()
constructor is
called, it must run the following algorithm:
- Create a new MessagePort
object owned by the script's
- global object, and let port1 be that object.
+ Create a new MessagePort
object whose owner
+ is the settings object
+ of the incumbent script, and let port1 be that object.
- Create a new MessagePort
object owned by the script's
- global object, and let port2 be that object.
+
+ Create a new MessagePort
object whose owner
+ is the settings object
+ of the incumbent script, and let port2 be that object.
Entangle the port1 and port2
objects.
@@ -80000,21 +80105,30 @@ interface MessageChannel {
message queue, initially empty. A port message queue can be enabled or
disabled, and is initially disabled. Once enabled, a port can never be disabled again (though
messages in the queue can get moved to another queue or removed altogether, which has much the
- same effect). A MessagePort
also has a has been shipped flag. It must
- initially be false.
+ same effect). A MessagePort
also has a has been shipped flag, which must
+ initially be false, and an owner, which is a settings
+ object set when the object is created, as described below.
+
When a port's port message queue is enabled, the event loop must use
- it as one of its task sources.
-
- If the Document
of the port's event listeners' global object is not fully active, then the messages are
+ it as one of its task sources. All tasks queued on the port
+ message queue must be associated with the responsible document specified by
+ the port's owner.
+
+
+ If the port's owner specifies a responsible document that is fully active,
+ but the event listeners all have scripts whose settings objects
+ specify responsible documents that are not fully active, then the messages will be
lost.
+
Each event loop has a task source called the unshipped port
message queue. This is a virtual task source: it must act as if it contained
the tasks of each port message queue of each
- MessagePort
whose has been shipped flag is false and whose port
- message queue is enabled, in the order in which they were added to their respective
+ MessagePort
whose has been shipped flag is false, whose port
+ message queue is enabled, and whose owner
+ specifies that event loop as the responsible event loop,
+ in the order in which they were added to their respective
task source. When a task would be removed from the
unshipped port message queue, it must instead be removed from its port message
queue.
@@ -80029,9 +80143,10 @@ interface MessageChannel {
is true, its port message queue acts as a first-class task source,
unaffected to any unshipped port message queue.
- When the user agent is to create a new MessagePort
object owned by a
- script's global object object owner, it must instantiate a new
- MessagePort
object, and let its owner be owner.
+
+ When the user agent is to create a new MessagePort
object with a particular
+ settings object as its owner, it must instantiate a new
+ MessagePort
object, and let its owner be owner.
When the user agent is to entangle two MessagePort
objects, it must run
the following steps:
@@ -80069,7 +80184,7 @@ interface MessageChannel {
Set original port's has been shipped flag to
true.
- Create a new MessagePort
object owned by owner, and let new port be that object.
+ Create a new MessagePort
object whose owner is owner, and let new port be that object.
Set new port's has been shipped flag to true.
@@ -80176,7 +80291,8 @@ interface MessageChannel {
-
-
Let new owner be the owner of target port, if there
+
+
Let new owner be the owner of target port, if there
is a target port, or else some arbitrary owner. (This new
owner is used when transferring objects below. If there is no target
port, the Transferable
objects given in the second argument, if any, are
@@ -80238,8 +80354,9 @@ interface MessageChannel {
Let message be the method's first argument.
- Create a new MessagePort
object owned by the script's
- global object, and let port1 be that object.
+ Create a new MessagePort
object whose owner is the incumbent script's settings
+ object, and let port1 be that object.
If the source port is not entangled with another port, then return
port1 and abort these steps.
MessageChannel {
Let target port be the port with which source port
is entangled.
- Create a new MessagePort
object owned by the owner of the target port, and let port2 be that object.
+ Create a new MessagePort
object whose owner is the owner of
+ the target port, and let port2 be that object.
Entangle the port1 and port2
objects.
@@ -80402,9 +80520,10 @@ callback PortCollectionCallback = void (
+
When a MessagePort
object o is entangled, user agents must
either act as if o's entangled MessagePort
object has a strong
- reference to o, or as if o's owner has a strong reference
+ reference to o, or as if the global object specified by o's owner has a strong reference
to o.
@@ -81595,7 +81714,7 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
JavaScript if the JavaScript global environment is a shared worker
environment.
- Shared workers receive message ports through connect
events on their global object for each
+
Shared workers receive message ports through connect
events on their SharedWorkerGlobalScope
object for each
connection.
The name
attribute must return
@@ -81672,14 +81791,15 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
it must be removed from the list of the worker's Document
s of each
worker whose list contains that Document
.
- Given a script's global object o when creating or obtaining a
+
+
Given a settings object o when creating or obtaining a
worker, the list of relevant Document
objects to add depends on the type
- of o. If o is a WorkerGlobalScope
object
+ of global object specified by o's. If o
+ specifies a global object that is a WorkerGlobalScope
object
(i.e. if we are creating a nested worker), then the relevant Document
s are the
- Document
s that are in o's own list of the worker's
- Document
s. Otherwise, o is a Window
object,
- and the relevant Document
is just the Document
that is the active
- document of the Window
object o.
+ the worker's Document
s of the global object specified by
+ o. Otherwise, o specifies a global object that is a Window
object,
+ and the relevant Document
is just the responsible document specified by o.
A worker is said to be a permissible worker if its list of the worker's
Document
s is not empty.
@@ -81698,8 +81818,9 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
10.2.4 Processing model
- When a user agent is to run a worker for a script with URL url, a browsing context owner browsing context, a
- Document
owner document, an origin owner origin, and with global scope worker global scope, it
+
+
When a user agent is to run a worker for a script with URL url, a script settings object settings object,
+ and an origin owner origin, it
must run the following steps:
-
@@ -81712,6 +81833,9 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
+ Let worker global scope be the global object specified
+ by settings object.
+
If worker global scope is actually a
SharedWorkerGlobalScope
object (i.e. the worker is a shared worker), and there are
any relevant application caches that are
@@ -81724,8 +81848,8 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
-
Attempt to fetch the resource identified by url,
- from the owner origin, using owner document as the
- referrer source, with the synchronous flag set and the force same-origin
+ from the owner origin, using the responsible document specified by settings object as the
+ referrer source (not the specified API referrer source!), with the synchronous flag set and the force same-origin
flag set.
If the attempt fails, then for each Worker
or SharedWorker
object
@@ -81745,7 +81869,7 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
In the newly created execution environment, create a JavaScript global
- environment whose global object is worker global scope. If worker global scope is a DedicatedWorkerGlobalScope
object, then this
+ environment whose global object is worker global scope. If worker global scope is a DedicatedWorkerGlobalScope
object, then this
is a dedicated worker environment. Otherwise, worker global
scope is a SharedWorkerGlobalScope
object, and this is a shared worker
environment. (In either case, by definition, it is a worker
@@ -81753,28 +81877,17 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
-
-
A new script is now created, as follows.
+ Let script be a new script.
- Create a new script execution environment set up as appropriate for the
- scripting language language.
+ Obtain the appropriate script execution environment for the scripting language
+ language from settings object.
Parse/compile/initialize source using that script execution
environment, as appropriate for language, and thus obtain a
code entry-point.
- Set the script's global object to worker global scope.
-
- Set the script's browsing context to owner browsing
- context.
-
- Set the script's document to owner document.
-
- Set the script's referrer source to url.
-
- Set the script's URL character encoding to UTF-8. (This is just used for
- encoding non-ASCII characters in the query component of URLs.)
-
- Set the script's base URL to url.
+ Let script's settings object be settings
+ object.
@@ -81821,8 +81934,8 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
-
-
Event loop: Create a new event
- loop, and run it until it is destroyed.
+ Event loop: Run the responsible
+ event loop specified by settings object until it is destroyed.
The handling of events or the execution of callbacks by tasks run by the event loop might get prematurely
aborted by the "kill a worker" or "terminate a worker" algorithms
@@ -81971,7 +82084,97 @@ interface AbstractWorker {
Event handler Event handler event type
onerror
error
-
10.2.6.2 Dedicated workers and the Worker
interface
+ 10.2.6.2 Script settings for workers
+
+ When the user agent is required to set up a worker script settings object, given a
+ worker global scope, it must run the following steps:
+
+ Let inherited responsible browsing context be the responsible
+ browsing context specified by the incumbent script's settings
+ object.
+
+ Let inherited responsible document be the responsible
+ document specified by the incumbent script's settings
+ object.
+
+ Let worker event loop be a newly created event
+ loop.
+
+ -
+
+
Let settings object be a new script settings object whose
+ algorithms are defined as follows:
+
+ - The script execution environments
+ -
+
+
When the script settings object is created, for each language supported by the
+ user agent, create an appropriate execution environment as defined by the relevant
+ specification.
+
+ When a script execution environment is needed, return the appropriate one from
+ those created when the script settings object was created.
+
+ Currently, workers only support JavaScript, so only a JavaScript execution
+ environment is actually needed here.
+
+
+
+ - The global object
+ -
+
+
Return worker global scope.
+
+
+
+ - The responsible browsing context
+ -
+
+
Return inherited responsible browsing context.
+
+
+
+ - The responsible document
+ -
+
+
Return inherited responsible document.
+
+
+
+ - The responsible event loop
+ -
+
+
Return worker event loop.
+
+
+
+ - The API referrer source
+ -
+
+
Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The API URL character encoding
+ -
+
+
Return UTF-8.
+
+
+
+ - The API base URL
+ -
+
+
Return worker URL.
+
+
+
+
+
+ Return settings object.
+
+
10.2.6.3 Dedicated workers and the Worker
interface
[Constructor(DOMString scriptURL)]
interface Worker : EventTarget {
@@ -82027,17 +82230,21 @@ interface Worker : EventTarget {
the request violates a policy decision (e.g. if the user agent is configured to not allow the
page to start dedicated workers).
+
Resolve the scriptURL argument
- relative to the entry script's base URL, when
- the method is invoked.
+ relative to the API base URL specified by the entry script's settings object when
+ the method was invoked.
If this fails, throw a SyntaxError
exception and abort these steps.
+ Let worker URL be the resulting absolute URL.
+
-
-
If the scheme component of the resulting parsed
- URL is not "data
", and the origin of the
- resulting absolute URL is not the same as the
+
+
If the scheme component of worker URL
+ is not "data
", and the origin of worker URL
+ is not the same as the
origin of the entry script, then throw a SecurityError
exception and
abort these steps.
@@ -82052,16 +82259,22 @@ interface Worker : EventTarget {
origin is the origin of the entry script. Let worker global
scope be this new object.
+ Set up a worker script settings object with worker global
+ scope, and let settings object be the result.
+
Create a new Worker
object, associated with worker global
scope. Let worker be this new object.
- Create a new MessagePort
object owned by the global object of the incumbent script. Let
+
+
Create a new MessagePort
object whose owner
+ is the settings object of the incumbent script. Let
this be the outside port.
Associate the outside port with worker.
- Create a new MessagePort
object owned by worker
- global scope. Let inside port be this new object.
+
+ Create a new MessagePort
object whose owner is script settings
+ Let inside port be this new object.
Associate inside port with worker global
scope.
@@ -82079,8 +82292,9 @@ interface Worker : EventTarget {
-
+
Let docs be the list of relevant Document
objects to
- add given the global object of the
+ add given the settings object of the
incumbent script.
@@ -82095,25 +82309,24 @@ interface Worker : EventTarget {
-
-
If the global object of the incumbent
- script is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
+
+
If the global object specified by the incumbent
+ script's settings object is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
add worker global scope to the list of the worker's workers of
- the WorkerGlobalScope
object that is the global object of the incumbent script.
+ the WorkerGlobalScope
object that is the global object of the incumbent script's settings object.
-
-
Run a worker for the resulting absolute URL, with the
- script's browsing context of the incumbent script as the owner browsing context, with the script's document of the
- incumbent script as the owner document, with the
- origin of the entry script as the owner origin,
- and with worker global scope as the global scope.
+ Run a worker for the script with URL worker
+ URL, the script settings object settings object, and the
+ origin of the entry script as the owner
+ origin.
-
10.2.6.3 Shared workers and the SharedWorker
interface
+ 10.2.6.4 Shared workers and the SharedWorker
interface
[Constructor(DOMString scriptURL, optional DOMString name)]
interface SharedWorker : EventTarget {
@@ -82160,7 +82373,7 @@ interface SharedWorker : EventTa
-
Let docs be the list of relevant Document
objects to
- add given the global object of the
+ add
given the settings object of the
incumbent script.
@@ -82172,7 +82385,9 @@ interface SharedWorker : EventTa
Create a new SharedWorker
object, which will shortly be associated with a
SharedWorkerGlobalScope
object. Let this SharedWorker
object be worker.
- Create a new MessagePort
object owned by the global object of the incumbent script. Let
+
+
Create a new MessagePort
object whose owner
+ is the settings object of the incumbent script. Let
this be the outside port.
Assign outside port to the port
attribute of worker.
@@ -82217,7 +82432,12 @@ interface SharedWorker : EventTa
Associate worker with worker global
scope.
- Create a new MessagePort
object owned by worker global scope. Let this be the inside port.
+ Let settings object be the script settings object
+ whose global object is worker global scope.
+
+
+ Create a new MessagePort
object whose owner
+ is settings object. Let this be the inside port.
Entangle outside port
and inside port.
@@ -82241,11 +82461,12 @@ interface SharedWorker : EventTa
-
-
If the global object of the incumbent
- script is a WorkerGlobalScope
object, add worker global
+
+ If the global object specified by the incumbent
+ script's settings object is a WorkerGlobalScope
object, add worker global
scope to the list of the worker's workers of the
- WorkerGlobalScope
object that is the global object of the incumbent script.
+ WorkerGlobalScope
object that is the global
+ object specified by the incumbent script's settings object.
@@ -82253,17 +82474,23 @@ interface SharedWorker : EventTa
+
+
Create a new SharedWorkerGlobalScope
object whose worker
origin is the origin of the entry script. Let worker global
scope be this new object.
+ Set up a worker script settings object with worker global
+ scope, and let settings object be the result.
+
Associate worker with worker global
scope.
Set the name
attribute of worker global scope to name.
- Create a new MessagePort
object owned by worker
- global scope. Let inside port be this new object.
+
+ Create a new MessagePort
object whose owner is settings object.
+ Let inside port be this new object.
Entangle outside port and inside
port.
@@ -82291,21 +82518,18 @@ interface SharedWorker : EventTa
-
-
If the global object of the incumbent
- script that invoked the constructor is a WorkerGlobalScope
object, add worker global scope to the list of the worker's workers of the
- WorkerGlobalScope
object that is the global
- object of the incumbent script.
+
+ If the global object specified by the settings object of the incumbent
+ script is a WorkerGlobalScope
object, add worker global scope to the list of the worker's workers of the
+ WorkerGlobalScope
object that is the global
+ object specified by the incumbent script's settings object.
-
-
Run a worker for scriptURL, with the script's browsing
- context of the incumbent script as the owner browsing
- context, with the script's document of the incumbent script the
- owner document, with the origin of the entry
- script as the owner origin, and with worker global
- scope as the global scope.
+ Run a worker for the script with URL scriptURL, the script settings object settings
+ object, and the origin of the entry script as the owner origin.
@@ -82336,15 +82560,19 @@ interface SharedWorker : EventTa
If there are no arguments, return without doing anything. Abort these steps.
+ Let settings object be the script settings object of the
+ incumbent script.
+
Resolve each argument.
If any fail, throw a SyntaxError
exception and abort these steps.
-
+
Attempt to fetch each resource identified by the resulting absolute URLs, from the entry script's
- origin, using the entry script's referrer source, and with the synchronous flag set.
@@ -82373,14 +82601,13 @@ interface SharedWorker : EventTa
-
-
Create a script, using source as the script source, the
- URL from which source was obtained, and language as the scripting language, using the same global object, browsing
- context, document, referrer source, URL character encoding, and base URL as the script that was created by the worker's run a
- worker algorithm.
+ Create a script using source as the script source, the
+ URL from which source was obtained, language as the scripting language, and settings object as
+ the script settings object.
If the script came from a resource whose URL does not have the same
origin as the worker origin, then pass the muted
- errors flag to the create a script from a node algorithm.
+ errors flag to the create a script algorithm as well.
Let the newly created script run until it either
returns, fails to parse, fails to catch an exception, or gets prematurely aborted by the
@@ -94972,7 +95199,7 @@ if (s = prompt('What is your name?')) {
- None of the elements in the
Document
are in any of the following namespaces: HTML namespace, SVG namespace, MathML namespace
- The
Document
has no focusable elements (e.g. from XLink).
- The
Document
has no hyperlinks (e.g. from XLink).
- - There exists no script whose document is this
Document
.
+ - There exists no script whose settings object specifies this
Document
as the responsible document.
- None of the elements in the
Document
have any registered event listeners.
An unstyled document view is one where the DOM is not rendered according to CSS
(which would, since there are no applicable styles in this context, just result in a wall of
diff --git a/source b/source
index f2022990657..859037dea63 100644
--- a/source
+++ b/source
@@ -6050,7 +6050,8 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
- If the URL came from a script (e.g. as an argument to a method)
- - The URL character encoding is the script's URL character encoding.
+
+ - The URL character encoding is the API URL character encoding specified by the script's settings object.
- If the URL came from a DOM node (e.g. from an element)
@@ -8021,11 +8022,13 @@ interface Transferable { };
their user interface. This is the primary mechanism by which a user can tell if a site is
attempting to impersonate another.
+
When a Document
is created by a script using
the createDocument()
or createHTMLDocument()
APIs, the
- document's address is the same as the document's address of the script's
- document, and the Document
is both ready for post-load tasks and
+ document's address is the same as the document's address of the responsible
+ document specified by the script's settings
+ object, and the Document
is both ready for post-load tasks and
completely loaded immediately.
The document's referrer is an absolute URL that can be set when the
@@ -8545,6 +8548,8 @@ partial /*sealed*/ interface Document {
+
+
@@ -8865,8 +8870,10 @@ partial /*sealed*/ interface Document {
Let document be the XMLDocument
object on which the
method was invoked.
+
Resolve the method's first argument, relative to the
- entry script's base URL. If this is not
+ API base URL specified by the
+ entry script's settings object. If this is not
successful, throw a SyntaxError
exception and abort these steps. Otherwise, let url be the resulting absolute URL.
@@ -8893,9 +8900,10 @@ partial /*sealed*/ interface Document {
Let success be false.
+
Fetch url from the origin of
- document, using the entry script's referrer source, with the synchronous flag set and the document, using the API referrer source specified by the entry script's
+ settings object, with the synchronous flag set and the force same-origin flag set.
-
@@ -57279,8 +57287,9 @@ dictionary RelatedEventInit : EventInit {
-
+
Let old script element be the value to which the
- Document
element's script
element's Document
's currentScript
object was most recently
initialized.
@@ -57288,7 +57297,8 @@ dictionary RelatedEventInit : EventInit {
-
-
Initialize the Document
element's
+ Initialize the script
element's Document
's currentScript
object to the script
element.
@@ -57296,15 +57306,17 @@ dictionary RelatedEventInit : EventInit {
-
-
Create a script from the
- script
element node, using the script block's source, the
- URL from which the script was obtained, and the script block's
- type.
+
+ Create a script, using the script block's source, the
+ URL from which the script was obtained, the script block's
+ type as the scripting language, and the script settings object of the script
element's
+ Document
's Window
object.
+
If the script came from a resource that was fetched in the
steps above, and the resource was CORS-cross-origin, then pass the muted errors flag to the create a script from a node
- algorithm.
+ data-x="">muted errors flag to the create a script
+ algorithm as well.
This is where the script is compiled and actually executed.
@@ -57312,7 +57324,8 @@ dictionary RelatedEventInit : EventInit {
-
-
Initialize the Document
element's
+ Initialize the script
element's Document
's currentScript
object to old script
element.
@@ -71495,12 +71508,14 @@ END:VCARD
present, and as if all the properties of that Window
object had their [[Enumerable]]
attribute set to false.
+
For members that return objects (including function objects), each distinct effective
script origin that is not the same as the Window
object's
Document
's effective script origin must be provided with a separate set
of objects. These objects must have the prototype chain appropriate for the script for which the
- objects are created (not those that would be appropriate for scripts whose script's global
- object is the Window
object in question).
+ objects are created (not those that would be appropriate for scripts whose global
+ object, as specified by their settings object,
+ is the Window
object in question).
@@ -71578,12 +71593,13 @@ END:VCARD
The method has four arguments, though they are all optional.
+
The first argument, url, must be a valid non-empty URL for a
page to load in the browsing context. If the first argument is the empty string, then the url argument must be interpreted as "about:blank
". Otherwise, the
argument must be resolved to an absolute URL (or
- an error), relative to the entry script's base
- URL, when the method is invoked.
+ an error), relative to the API base URL specified by the entry script's settings
+ object when the method was invoked.
The second argument, target, specifies the name of the browsing context that is to be navigated. It must be a valid
@@ -71618,14 +71634,15 @@ END:VCARD
browsing context, then throw an InvalidAccessError
exception and abort these
steps.
+
Otherwise, if url is not "about:blank
", the user agent must
navigate the selected browsing context to the
absolute URL obtained from resolving url earlier. If the replace is true or if the browsing
context was just created as part of the rules for choosing a browsing context given a
browsing context name, then replacement must be
- enabled. The navigation must be done with the browsing context of the incumbent script as the source browsing
+ enabled. The navigation must be done with the responsible
+ browsing context specified by the incumbent script's settings object as the source browsing
context. If the resolve a URL algorithm failed, then the user agent may either
instead navigate to an inline error page, using the same replacement behavior and
source browsing context behavior as described earlier in this paragraph; or treat the
- The corresponding browsing context A is
script-closable.
- - The browsing context of the incumbent
- script is familiar with the browsing context
+
- The responsible browsing context specified by the incumbent
+ script's settings object is familiar
+ with the browsing context A.
- - The browsing context of the
- incumbent script is allowed to navigate the browsing
+
+
- The responsible browsing context specified by the
+ incumbent script's settings object
+ is allowed to navigate the browsing
context A.
@@ -71719,13 +71740,15 @@ END:VCARD
+
The length
IDL attribute on the Window
interface must return the number of child browsing
contexts that are nested through
elements that are in the Document
that is the
active document of that Window
object, if that Window
's
- browsing context shares the same event loop as the script's
- browsing context of the entry script accessing the IDL attribute; otherwise,
+ browsing context shares the same event loop as the responsible
+ document specified by the settings object of the
+ entry script accessing the IDL attribute; otherwise,
it must return zero.
@@ -71869,9 +71892,10 @@ END:VCARD
objects have implied strong references to the
WindowProxy
object.
- Each script has a strong reference to its browsing context and its document.
+
+ Each script has a strong reference to its settings
+ object, and each script settings object
+ has strong references to its global object, responsible browsing context, and responsible document.
When a browsing context is to discard a Document
, the user
@@ -73416,8 +73440,10 @@ x === this; // true
+
- Resolve the value of the third argument, relative to the
- entry script's base URL.
+ API base URL specified by the
+ entry script's settings object.
- If that fails, throw a
SecurityError
exception and abort these steps.
@@ -73428,9 +73454,10 @@ x === this; // true
data-x="concept-url-fragment">fragment components, then throw a
SecurityError
exception and abort these steps.
+
- If the origin of the resulting absolute URL is not the same as
- the origin of the entry script's document, and either the path or origin of the responsible document specified by the entry script's
+ settings object, and either the path or query components of the two parsed
URLs compared in the previous step differ, throw a
SecurityError
exception
and abort these steps. (This prevents sandboxed content from spoofing other pages on the same
@@ -73712,9 +73739,10 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
The relevant Document
is the Location
object's associated
Document
object's browsing context's active document.
+
When the assign(url)
method is invoked, the UA must resolve the argument, relative
- to the entry script's base URL, and if that is
+ to the API base URL specified by the entry script's settings object, and if that is
successful, must navigate the browsing
context to the specified url. If the browsing context's
session history contains only one Document
, and that was the
@@ -73724,15 +73752,17 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
Safari doesn't check that. Thus this might need changing if testing shows the IE/Firefox behaviour
is required here. -->
+
When the replace(url)
method is invoked, the UA must resolve the argument, relative
- to the entry script's base URL, and if that is
+ to the API base URL specified by the entry script's settings object, and if that is
successful, navigate the browsing
context to the specified url with replacement enabled.
+
Navigation for the assign()
and replace()
methods must be done with the browsing context of the incumbent script as the source
+ data-x="dom-location-replace">replace() methods must be done with the responsible browsing context specified by
+ the incumbent script's settings object as the source
browsing context.
If the resolving step of the 1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
input algorithm with the address of the
relevant Document
as the given value.
+
The element's URLUtils
interface's get the
- base algorithm must return the entry script's base URL, if there is one, or null otherwise.
+ base algorithm must return the API base URL specified by the entry script's
+ settings object, if there is one, or null otherwise.
The element's URLUtils
interface's query
encoding is the document's character encoding.
@@ -73874,12 +73905,16 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
- - The
href
setter, if the entry script's
- script's browsing context is familiar with the browsing
+
+ - The
href
setter, if the responsible browsing context
+ specified by the entry script's
+ settings object is familiar with the browsing
context with which the Location
object is associated
- - The
replace()
method, if the entry
- script's script's browsing context is familiar with the
+
+ - The
replace()
method, if the responsible
+ browsing context specified by the entry script's
+ settings object is familiar with the
browsing context with which the Location
object is associated
- Any properties not defined in the IDL for the
Location
object or indirectly via
@@ -73896,12 +73931,13 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
properties, getters, setters, etc, were not present, and as if all the properties of that
Location
object had their [[Enumerable]] attribute set to false.
+
For members that return objects (including function objects), each distinct effective
script origin that is not the same origin as the Location
object's Document
's effective script origin must be provided with a
separate set of objects. These objects must have the prototype chain appropriate for the script
for which the objects are created (not those that would be appropriate for scripts whose
- script's global object is the Location
object's Document
's
+ settings object specifies a global object that is the Location
object's Document
's
Window
object).
@@ -75522,7 +75558,7 @@ dictionary PageTransitionEventInit : EventInit {
-
Make disappear any WebSocket
objects that were created by the WebSocket()
constructor whose global object is the
+ data-x="dom-WebSocket">WebSocket() constructor from the
Document
's Window
object.
If this affected any WebSocket
objects, then set Document
's NavigatorOnLine {
information).
-
- - A script execution environment
+
+ - A script execution environment for each language supported by the user agent
-
@@ -78058,19 +78101,18 @@ interface NavigatorOnLine {
- - A relationship with the script's global object
-
+ - A global object
-
-
An object that provides the APIs that the code can use.
+ An object that provides the APIs that can be called by the code in scripts that use this
+ settings object.
- This is typically a Window
object. In JavaScript, this
- corresponds to the global object.
+ This is typically a Window
object or a
+ WorkerGlobalScope
object. When a global object is an empty object, it
+ can't do anything that interacts with the environment.
- When a script's global object is an empty object, it can't do
- anything that interacts with the environment.
-
- If the script's global object is a Window
object, then in
+
+
If the global object is a Window
object, then, in
JavaScript, the ThisBinding of the global execution context for this script must be the
Window
object's WindowProxy
object, rather than the global object. [ECMA262]
@@ -78084,73 +78126,159 @@ interface NavigatorOnLine {
- - A relationship with the script's browsing context
+ - A responsible browsing context
-
A browsing context that is assigned responsibility for actions taken by the
- script.
+ scripts that use this script settings object.
When a script creates and navigates a new
- top-level browsing context, the opener
attribute of
- the new browsing context's Window
object will be set to the
- script's browsing context's WindowProxy
object.
+ top-level browsing context, the opener
attribute
+ of the new browsing context's Window
object will be set to the
+ responsible browsing context's WindowProxy
object.
- - A relationship with the script's document
+ - A responsible document
-
-
A Document
that is assigned responsibility for actions taken by the script.
+ A Document
that is assigned responsibility for actions taken by the scripts that
+ use this script settings object.
+
For example, the address of the
- script's document is used to set the address of any Document
elements created using responsible document is used to set the address of any Document
s created using createDocument()
.
- - The script's referrer source
+ - A responsible event loop
-
-
Either a Document
(specifically, the script's document), or a
+
An event loop that is used when it would not be immediately clear what event
+ loop to use.
+
+
+
+ - An API referrer source
+
+ -
+
+
Either a Document
(specifically, the responsible document), or a
URL, which is used by some APIs to determine what value to use for the Referer
(sic) header in calls to the fetching algorithm.
- - A URL character encoding
+ - An API URL character encoding
-
-
A character encoding, set when the script is created, used to encode URLs. If the character encoding is set from another source, e.g. a
- document's character encoding, then the script's URL character
- encoding must follow the source, so that if the source's changes, so does the
- script's.
+
+ A character encoding used to encode URLs by APIs called by scripts that use
+ this script settings object.
- - A base URL
+ - An API base URL
-
-
A URL, set when the script is created, used to resolve relative URLs. If the base URL is set from another
- source, e.g. a document base URL, then the script's base URL must
- follow the source, so that if the source's changes, so does the script's.
+
+ An absolute URL used by APIs called by scripts that use
+ this script settings object to resolve relative URLs.
+
+
+
+
+
+
+
+ Script settings for browsing contexts
+
+ Whenever a new Window
object is created, it must also create a script
+ settings object whose algorithms are defined as follows:
+
+
+
+ - The script execution environments
+ -
+
+
When the script settings object is created, for each language supported by the
+ user agent, create an appropriate execution environment as defined by the relevant
+ specification.
+
+ When a script execution environment is needed, return the appropriate one from
+ those created when the script settings object was created.
+
+
+
+ - The global object
+ -
+
+
Return the Window
object itself.
+
+
+
+ - The responsible browsing context
+ -
+
+
Return the browsing context with which the Window
object is
+ associated.
+
+
+
+ - The responsible document
+ -
+
+
Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The responsible event loop
+ -
+
+
Return the event loop that is associated with the unit of related
+ similar-origin browsing contexts to which the Window
object's browsing
+ context belongs.
+
+
+
+ - The API referrer source
+ -
+
+
Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The API URL character encoding
+ -
+
+
Return the current character encoding of
+ the Document
with which the Window
is currently associated.
+
+
+
+ - The API base URL
+ -
+
+
Return the current base URL of the
+ Document
with which the Window
is currently associated.
-
-
Calling scripts
@@ -78173,8 +78301,10 @@ interface NavigatorOnLine {
data-x="concept-script">script. If this returns "do not run" then abort these
steps.
- Make the script execution environment
- for s execute the script's code
+
+ Make the appropriate script execution environment
+ specified by s's settings
+ object execute the script's code
entry-point.
Clean up after running a callback.
@@ -78188,12 +78318,14 @@ interface NavigatorOnLine {
- If the global object of o
+
+
If the global object specified by o's settings object
is a Window
object whose Document
object is not fully
active, then return "do not run" and abort these steps.
- If scripting is disabled for o's browsing context, then return
+
+
If scripting is disabled for the responsible browsing context specified by o's settings object, then return
"do not run" and abort these steps.
Push s onto the stack of incumbent scripts, and label it
@@ -78244,7 +78376,7 @@ interface NavigatorOnLine {
data-x="concept-script">script
in the stack of incumbent scripts that is
labeled as a candidate entry script. If the stack is
empty, or has no entries labeled as such, then there is no entry script. It is used
- to obtain, amongst other things, the script's base URL to resolve relative URLs used in scripts running in that
unit of related similar-origin browsing contexts.
@@ -78284,9 +78416,8 @@ interface NavigatorOnLine {
When the specification says that a script is to be created, given some script source, a script source URL, its
- scripting language, a global object, a browsing context, a document, a referrer source, a URL
- character encoding, a base URL, and optionally a muted errors flag, the user
- agent must run the following steps:
+ scripting language, a script settings object, and optionally a muted
+ errors flag, the user agent must run the following steps:
@@ -78297,17 +78428,15 @@ interface NavigatorOnLine {
context passed to this algorithm, then abort these steps, as if the script source
described a program that did nothing but return void.
- Set up a script execution environment as appropriate for the given scripting
- language.
+ Obtain the appropriate script execution environment for the given scripting
+ language from the script settings object provided.
Parse/compile/initialize the source of the script using the script execution
environment, as appropriate for the scripting language, and thus obtain script's code entry-point.
- Set up the script's global object, the script's browsing
- context, the script's document, the script's referrer source,
- the script's URL character encoding, and the script's base URL from the
- settings passed to this algorithm.
+ Let script's settings object be the script
+ settings object provided.
If the muted errors flag was set, then set script's muted errors flag.
@@ -78318,8 +78447,9 @@ interface NavigatorOnLine {
Jump to script's code
entry-point.
+
Otherwise, report the error for script, with the problematic
- position (line number and column number), using the script's global object as the
+ position (line number and column number), using the global object specified by the script settings object as the
target. If the error is still not handled after this,
then the error may be reported to the user.
@@ -78327,43 +78457,6 @@ interface NavigatorOnLine {
-
-
- When the specification says that a script is to be created from a node node, given some
- script source, its URL, its scripting language, and optionally a muted errors
- flag, the user agent must create a script, using the given script source, URL, and
- scripting language, the script settings determined from the node node, and, if the muted errors flag was set in the call to this
- algorithm, the muted errors flag.
-
- The script settings determined from the node node are computed
- as follows:
-
-
-
- Let document be the Document
of node
- (or node itself if it is a Document
).
-
- The global object is the Window
object of document.
-
- The browsing context is the browsing context of document.
-
- The document is document.
-
- The referrer source is document.
-
- The URL character encoding is the character
- encoding of document. (This is a reference,
- not a copy.)
-
- The base URL is the base URL of document. (This is a reference, not a copy.)
-
-
-
@@ -78495,10 +78588,11 @@ interface NavigatorOnLine {
Runtime script errors in documents
+
Whenever an uncaught runtime script error occurs in one of the scripts associated with a
Document
, the user agent must report the error for the relevant script, with the problematic position (line number and column
- number) in the resource containing the script, using the script's global object as
+ number) in the resource containing the script, using the global object specified by the script's settings object as
the target. If the error is still not handled after this,
then the error may be reported to the user.
@@ -78621,7 +78715,7 @@ dictionary ErrorEventInit : EventInit {
the task was queued in the context of a browsing context, then it is the
browsing context's active document at the time the task was queued; if
the task was queued by or for a script then the document is
- the script's document.
+ the responsible document specified by the script's settings object.
A task is intended for a specific event loop:
the event loop that is handling tasks for the ErrorEventInit : EventInit {
-
+
Invoke MutationObserver
objects for the
- unit of related similar-origin browsing contexts to which the script's
- browsing context belongs, using the task wrapper algorithm as the steps to
+ unit of related similar-origin browsing contexts to which the responsible
+ browsing context specified by the script's settings object belongs, using the task wrapper algorithm as the steps to
invoke each callback.
This will typically invoke scripted callbacks, which calls the jump to a
@@ -78970,10 +79065,10 @@ dictionary ErrorEventInit : EventInit {
data-x="">address be the address of the
creator Document
instead.
- Create a script from the
- Document
node of the active document, using the aforementioned
- script source, the URL of the resource where the javascript:
URL,
- was found, and assuming the scripting language is JavaScript.
+ Create a script, using the aforementioned script source, the URL
+ of the resource where the javascript:
URL, was found, JavaScript as the scripting
+ language, and the script settings object of the Window
object of the
+ active document.
Let result be the return value of the code entry-point
of this script. If an exception was thrown, let ErrorEventInit : EventInit {
Set the corresponding event handler to null.
- Set up a script execution environment for JavaScript.
+ Let script settings be the script settings object of the
+ Window
object associated with the browsing context to which belongs the
+ Document
of the element in question.
+
+ Obtain the script execution environment for JavaScript from script settings.
Let body be the event
handler content attribute's new value.
@@ -79164,7 +79264,8 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
-
-
Using the script execution environment created above, create a function object (as defined in
+
+
Using the script execution environment obtained above, create a function object (as defined in
ECMAScript edition 5 section 13.2 Creating Function Objects), with:
@@ -79227,15 +79328,13 @@ currently this is unnecessary: http://www.w3.org/Bugs/Public/show_bug.cgi?id=119
- Let this new function be the script's code entry-point.
+
+ Let this new function be a new script's code entry-point.
- Set up the script's global object, the script's browsing
- context, the script's document, the script's referrer source,
- the script's URL character encoding, and the script's base URL from
- the script settings determined from the node on which the attribute is being
- set.
+ Let that script's settings object be
+ script settings.
Set the corresponding event handler to the
aforementioned function.
@@ -80142,14 +80241,21 @@ interface WindowBase64 {
Remove all child nodes of the document, without firing any mutation events.
- Replace the Document
's singleton objects with new instances of those objects.
- (This includes in particular the Window
, Location
,
- History
, ApplicationCache
, and Navigator
, objects, the
- various BarProp
objects, the two Storage
objects, the various
- HTMLCollection
objects, and objects defined by other specifications, like
- Selection
and the document's UndoManager
. It also includes all the Web
- IDL prototypes in the JavaScript binding, including the Document
object's
- prototype.)
+ -
+
+
Replace the Document
's singleton objects with new instances of those objects.
+ (This includes in particular the Window
, Location
,
+ History
, ApplicationCache
, and Navigator
, objects, the
+ various BarProp
objects, the two Storage
objects, the various
+ HTMLCollection
objects, and objects defined by other specifications, like
+ Selection
and the document's UndoManager
. It also includes all the Web
+ IDL prototypes in the JavaScript binding, including the Document
object's
+ prototype.)
+
+ The new Window
object has a new script settings
+ object.
+
+
@@ -80163,9 +80269,10 @@ interface WindowBase64 {
Set the Document
's salvageable state back to true.
- Change the document's address to the entry script's document's address.
+
+ Change the document's address to the address of the responsible document specified by
+ the entry script's settings object.
@@ -80649,42 +80756,15 @@ interface WindowTimers {
Let script language be JavaScript.
- -
-
-
If method context is a Window
object, let global object be method context, let browsing context be the browsing context with which global object is associated, let document and referrer source be the Document
associated with global object, let character encoding be the character encoding of the Document
- associated with global object (this is a
- reference, not a copy), and let base URL be the base URL of the Document
associated with global object (this is a reference, not a
- copy).
-
- Otherwise, method context is a WorkerGlobalScope
object;
- let global object, browsing context, document, referrer source, character
- encoding, and base URL be the script's global object,
- script's browsing context, script's document, script's
- referrer source, script's URL character encoding, and script's
- base URL (respectively) of the script that the
- run a worker algorithm created when it created method
- context.
-
-
+ Let settings object be method context's
+ script settings object.
- -
+
-
Create a script using script source as the script
source, the URL where script source can be found, scripting language as the scripting language, global
- object as the global object, browsing context as the browsing
- context, document as the document, referrer source
- as the referrer source, character encoding as the URL character
- encoding, and base URL as the base URL.
+ data-x="">scripting language as the scripting language, and settings
+ object as the script settings object.
@@ -80696,7 +80776,7 @@ interface WindowTimers {
- -
+
-
If the repeat flag is true, then call timer initialization
steps again, passing them the same method arguments, the same method
@@ -81084,7 +81164,8 @@ scheduleWork(); // queues a task to do lots of work
-
Resolve url relative to the
- entry script's base URL.
+ API base URL specified by
+ entry script's settings object.
If this fails, then throw a SyntaxError
exception and abort these steps.
@@ -81114,9 +81195,10 @@ scheduleWork(); // queues a task to do lots of work
-
+
If the active sandboxing flag set of the active document of the
- browsing context of the incumbent
- script has its sandboxed auxiliary navigation browsing context flag set,
+ responsible browsing context specified by the incumbent
+ script's settings object has its sandboxed auxiliary navigation browsing context flag set,
then return the empty string and abort these steps.
@@ -81176,11 +81258,11 @@ scheduleWork(); // queues a task to do lots of work
-
+
Set all the flags in the new browsing context's popup sandboxing flag set that
are set in the active sandboxing flag set of the active document of
- the browsing context of the incumbent
- script. The browsing context of the incumbent script
+ the responsible browsing context specified by the incumbent
+ script's settings object. The responsible browsing context specified by the incumbent script's settings object
must be set as the new browsing context's one permitted sandboxed
navigator.
@@ -81213,10 +81295,11 @@ scheduleWork(); // queues a task to do lots of work
-
+
Navigate the new browsing context to
the absolute URL that resulted from resolving
- url earlier, with replacement enabled, and with the browsing context of the incumbent script
+ url earlier, with replacement enabled, and with the responsible
+ browsing context specified by the incumbent script's settings object
as the source browsing context.
@@ -81729,9 +81812,10 @@ interface NavigatorContentUtils {
argument passed to one of these methods does not contain the exact literal string
"%s
".
+
User agents must throw a SyntaxError
exception if resolving the url argument relative to the entry
- script's base URL, is not successful.
+ url">resolving the url argument relative to the
+ API base URL specified by the entry script's settings object is not successful.
The resulting absolute URL would by definition not be a valid
URL as it would include the string "%s
" which is not a valid
@@ -81747,11 +81831,12 @@ interface NavigatorContentUtils {
The resulting absolute URL is the proto-URL. It identifies the
handler for the purposes of the methods described below.
+
When the user agent uses this handler, it must replace the first occurrence of the exact
literal string "%s
" in the url argument with an
escaped version of the absolute URL of the content in question (as defined below),
- then resolve the resulting URL, relative to the base URL of the entry script at the time the resolve the resulting URL, relative to the API
+ base URL specified by the entry script's settings object at the time the registerContentHandler()
or registerProtocolHandler()
methods were
invoked, and then navigate an appropriate browsing
@@ -81994,8 +82079,9 @@ interface NavigatorContentUtils {
If the string does not contain the substring "%s
", abort these
steps. There's no matching handler.
- Resolve the string relative to the base URL of the entry script.
+
+ Resolve the string relative to the API base URL
+ specified by the entry script's settings object.
If this fails, then throw a SyntaxError
exception, aborting the
method.
@@ -82717,9 +82803,9 @@ interface MimeType {
never does anything, or may arbitrarily ignore invocations with particular arguments for
security, privacy, or usability reasons.
+
Resolve the value of the method's first argument
- relative to the entry script's base
- URL.
+ relative to the API base URL specified by the entry script's settings object.
If this fails, abort these steps.
@@ -82746,9 +82832,10 @@ interface MimeType {
Let host1 be the host component of the origin of the
entry script.
+
Resolve the scriptURL argument
- relative to the entry script's base
- URL.
+ relative to the API base URL specified by the entry script's settings
+ object.
If this fails, return 0 and abort these steps.
@@ -87304,9 +87391,10 @@ dictionary EventSourceInit {
+
Resolve the URL specified in the first
- argument, relative to the entry script's base
- URL.
+ argument, relative to the API base URL specified by the entry script's settings
+ object.
[HTML]
@@ -87332,9 +87420,10 @@ dictionary EventSourceInit {
-
+
Do a potentially CORS-enabled fetch of the resulting absolute
- URL using the entry script's referrer
- source, with the mode being CORS mode, and the using the API referrer source specified by the entry script's settings
+ object, with the mode being CORS mode, and the origin being the entry script's origin, and process the resource obtained in this fashion, if any, as
@@ -89237,7 +89326,7 @@ function receiver(e) {
- -
+
-
Let message clone be the result of obtaining a structured
clone of the message argument, with transfer map
@@ -89253,14 +89342,14 @@ function receiver(e) {
- -
+
-
-
Let new owner be the Window
object on which the method was
+
Let new owner be the script settings object of the Window
object on which the method was
invoked.
- -
+
-
For each object x in transfer in turn, obtain a new
object y by new ports into a read only
array.
@@ -89291,10 +89380,11 @@ function receiver(e) {
-
+
If the targetOrigin argument is a single literal U+002F SOLIDUS character
(/), and the Document
of the Window
object on which the method was
- invoked does not have the same origin as the entry script's document, then abort these steps silently.
+ invoked does not have the same origin as the responsible document specified by the entry script's settings
+ object, then abort these steps silently.
Otherwise, if the targetOrigin argument is an absolute URL,
and the Document
of the Window
object on which the method was invoked
@@ -89308,6 +89398,7 @@ function receiver(e) {
-
+
Create a trusted event that uses the
MessageEvent
interface, with the event type message
, which does not bubble, is not cancelable, and has no
@@ -89317,7 +89408,10 @@ function receiver(e) {
data-x="Unicode serialization of an origin">Unicode serialization of the
origin of the incumbent script, the source
attribute must be initialized to the
- script's global object's WindowProxy
object, and the WindowProxy
object corresponding to the
+ global object (a Window
object) specified by the
+ incumbent script's settings object,
+ and the ports
attribute must be initialized to the new ports array.
@@ -89575,11 +89669,15 @@ interface MessageChannel {
- Create a new MessagePort
object owned by the script's
- global object, and let port1 be that object.
+
+ Create a new MessagePort
object whose owner
+ is the settings object
+ of the incumbent script, and let port1 be that object.
- Create a new MessagePort
object owned by the script's
- global object, and let port2 be that object.
+
+ Create a new MessagePort
object whose owner
+ is the settings object
+ of the incumbent script, and let port2 be that object.
Entangle the port1 and port2
objects.
@@ -89670,21 +89768,31 @@ interface MessageChannel {
message queue, initially empty. A port message queue can be enabled or
disabled, and is initially disabled. Once enabled, a port can never be disabled again (though
messages in the queue can get moved to another queue or removed altogether, which has much the
- same effect). A MessagePort
also has a has been shipped flag. It must
- initially be false.
+ same effect). A MessagePort
also has a has been shipped flag, which must
+ initially be false, and an owner, which is a settings
+ object set when the object is created, as described below.
+
When a port's port message queue is enabled, the event loop must use
- it as one of its task sources.
-
- If the Document
of the port's event listeners' global object is not fully active, then the messages are
+ it as one of its task sources. All tasks queued on the port
+ message queue must be associated with the responsible document specified by
+ the port's owner.
+
+
+ If the port's owner specifies a responsible document that is fully active,
+ but the event listeners all have scripts whose settings objects
+ specify responsible documents that are not fully active, then the messages will be
lost.
+
Each event loop has a task source called the unshipped port
message queue. This is a virtual task source: it must act as if it contained
the tasks of each port message queue of each
- MessagePort
whose has been shipped flag is false and whose port
- message queue is enabled, in the order in which they were added to their respective
+ MessagePort
whose has been shipped flag is false, whose port
+ message queue is enabled, and whose owner
+ specifies that event loop as the responsible event loop,
+ in the order in which they were added to their respective
task source. When a task would be removed from the
unshipped port message queue, it must instead be removed from its port message
queue.
@@ -89699,9 +89807,10 @@ interface MessageChannel {
is true, its port message queue acts as a first-class task source,
unaffected to any unshipped port message queue.
- When the user agent is to create a new MessagePort
object owned by a
- script's global object object owner, it must instantiate a new
- MessagePort
object, and let its owner be owner.
+
+ When the user agent is to create a new MessagePort
object with a particular
+ settings object as its owner, it must instantiate a new
+ MessagePort
object, and let its owner be owner.
When the user agent is to entangle two MessagePort
objects, it must run
the following steps:
@@ -89745,7 +89854,7 @@ interface MessageChannel {
Set original port's has been shipped flag to
true.
- Create a new MessagePort
object owned by Create a new MessagePort
object whose owner is owner, and let new port be that object.
Set new port's has been shipped flag to true.
@@ -89872,7 +89981,8 @@ interface MessageChannel {
-
-
Let new owner be the owner of target port, if there
+
+
Let new owner be the owner of target port, if there
is a target port, or else some arbitrary owner. (This new
owner is used when transferring objects below. If there is no target
port, the Transferable
objects given in the second argument, if any, are
@@ -89943,8 +90053,9 @@ interface MessageChannel {
Let message be the method's first argument.
- Create a new MessagePort
object owned by the script's
- global object, and let port1 be that object.
+ Create a new MessagePort
object whose owner is the incumbent script's settings
+ object, and let port1 be that object.
If the source port is not entangled with another port, then return
port1 and abort these steps.
MessageChannel {
Let target port be the port with which source port
is entangled.
- Create a new MessagePort
object owned by the owner of the target port, and let port2 be that object.
+ Create a new MessagePort
object whose owner is the owner of
+ the target port, and let port2 be that object.
Entangle the port1 and port2
objects.
@@ -90132,9 +90244,10 @@ callback PortCollectionCallback = void (MessagePort port
+
When a MessagePort
object o is entangled, user agents must
either act as if o's entangled MessagePort
object has a strong
- reference to o, or as if o's owner has a strong reference
+ reference to o, or as if the global object specified by o's owner has a strong reference
to o.
@@ -90729,7 +90842,7 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
environment.
Shared workers receive message ports through connect
events on their global object for each
+ data-x="event-WorkerGlobalScope-connect">connect events on their SharedWorkerGlobalScope
object for each
connection.
The name
attribute must return
@@ -90820,14 +90933,15 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
it must be removed from the list of the worker's Document
s of each
worker whose list contains that Document
.
- Given a script's global object o when creating or obtaining a
+
+
Given a settings object o when creating or obtaining a
worker, the list of relevant Document
objects to add depends on the type
- of o. If o is a WorkerGlobalScope
object
+ of global object specified by o's. If o
+ specifies a global object that is a WorkerGlobalScope
object
(i.e. if we are creating a nested worker), then the relevant Document
s are the
- Document
s that are in o's own list of the worker's
- Document
s. Otherwise, o is a Window
object,
- and the relevant Document
is just the Document
that is the active
- document of the Window
object o.
+ the worker's Document
s of the global object specified by
+ o. Otherwise, o specifies a global object that is a Window
object,
+ and the relevant Document
is just the responsible document specified by o.
@@ -90848,10 +90962,10 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
Processing model
+
When a user agent is to run a worker for a script with URL url, a browsing context owner browsing context, a
- Document
owner document, an origin owner origin, and with global scope worker global scope, it
+ data-x="">url, a script settings object settings object,
+ and an origin owner origin, it
must run the following steps:
@@ -90866,6 +90980,9 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
+ Let worker global scope be the global object specified
+ by settings object.
+
If worker global scope is actually a
SharedWorkerGlobalScope
object (i.e. the worker is a shared worker), and there are
any relevant application caches that are
@@ -90878,8 +90995,8 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
-
Attempt to fetch the resource identified by url,
- from the owner origin, using owner document as the
- referrer source, with the synchronous flag set and the force same-origin
+ from the owner origin, using the responsible document specified by settings object as the
+ referrer source (not the specified API referrer source!), with the synchronous flag set and the force same-origin
flag set.
If the attempt fails, then for each Worker
or SharedWorker
object
@@ -90908,29 +91025,17 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
-
-
A new script is now created, as follows.
+ Let script be a new script.
- Create a new script execution environment set up as appropriate for the
- scripting language language.
+ Obtain the appropriate script execution environment for the scripting language
+ language from settings object.
Parse/compile/initialize source using that script execution
environment, as appropriate for language, and thus obtain a
code entry-point.
- Set the script's global object to worker global scope.
-
- Set the script's browsing context to owner browsing
- context.
-
- Set the script's document to owner document.
-
- Set the script's referrer source to url.
-
- Set the script's URL character encoding to UTF-8. (This is just used for
- encoding non-ASCII characters in the query component of URLs.)
-
- Set the script's base URL to url.
+ Let script's settings object be settings
+ object.
@@ -90980,8 +91085,8 @@ worker.port.postMessage({ foo: 'structured', bar: ['data', 'also', 'possible']})
-
-
Event loop: Create a new event
- loop, and run it until it is destroyed.
+ Event loop: Run the responsible
+ event loop specified by settings object until it is destroyed.
The handling of events or the execution of callbacks by tasks run by the event loop might get prematurely
@@ -91166,6 +91271,104 @@ interface AbstractWorker {
+
Script settings for workers
+
+ When the user agent is required to set up a worker script settings object, given a
+ worker global scope, it must run the following steps:
+
+
+
+ Let inherited responsible browsing context be the responsible
+ browsing context specified by the incumbent script's settings
+ object.
+
+ Let inherited responsible document be the responsible
+ document specified by the incumbent script's settings
+ object.
+
+ Let worker event loop be a newly created event
+ loop.
+
+ -
+
+
Let settings object be a new script settings object whose
+ algorithms are defined as follows:
+
+
+
+ - The script execution environments
+ -
+
+
When the script settings object is created, for each language supported by the
+ user agent, create an appropriate execution environment as defined by the relevant
+ specification.
+
+ When a script execution environment is needed, return the appropriate one from
+ those created when the script settings object was created.
+
+ Currently, workers only support JavaScript, so only a JavaScript execution
+ environment is actually needed here.
+
+
+
+ - The global object
+ -
+
+
Return worker global scope.
+
+
+
+ - The responsible browsing context
+ -
+
+
Return inherited responsible browsing context.
+
+
+
+ - The responsible document
+ -
+
+
Return inherited responsible document.
+
+
+
+ - The responsible event loop
+ -
+
+
Return worker event loop.
+
+
+
+ - The API referrer source
+ -
+
+
Return the Document
with which the Window
is currently
+ associated.
+
+
+
+ - The API URL character encoding
+ -
+
+
Return UTF-8.
+
+
+
+ - The API base URL
+ -
+
+
Return worker URL.
+
+
+
+
+
+
+
+ Return settings object.
+
+
+
Dedicated workers and the Worker
interface
@@ -91234,17 +91437,21 @@ interface Worker : EventTarget {
the request violates a policy decision (e.g. if the user agent is configured to not allow the
page to start dedicated workers).
+
Resolve the scriptURL argument
- relative to the entry script's base URL, when
- the method is invoked.
+ relative to the API base URL specified by the entry script's settings object when
+ the method was invoked.
If this fails, throw a SyntaxError
exception and abort these steps.
+ Let worker URL be the resulting absolute URL.
+
-
-
If the scheme component of the resulting parsed
- URL is not "data
", and the origin of the
- resulting absolute URL is not the same as the
+
+
If the scheme component of worker URL
+ is not "data
", and the origin of worker URL
+ is not the same as the
origin of the entry script, then throw a SecurityError
exception and
abort these steps.
@@ -91260,17 +91467,22 @@ interface Worker : EventTarget {
origin is the origin of the entry script. Let worker global
scope be this new object.
+ Set up a worker script settings object with worker global
+ scope, and let settings object be the result.
+
Create a new Worker
object, associated with worker global
scope. Let worker be this new object.
- Create a new MessagePort
object owned by the global object of the incumbent script. Let
+
+
Create a new MessagePort
object whose owner
+ is the settings object of the incumbent script. Let
this be the outside port.
Associate the outside port with worker.
- Create a new MessagePort
object owned by worker
- global scope. Let inside port be this new object.
+
+ Create a new MessagePort
object whose owner is script settings
+ Let inside port be this new object.
Associate inside port with worker global
scope.
@@ -91288,8 +91500,9 @@ interface Worker : EventTarget {
-
+
Let docs be the list of relevant Document
objects to
- add given the global object of the
+ add given the settings object of the
incumbent script.
@@ -91304,22 +91517,20 @@ interface Worker : EventTarget {
-
-
If the global object of the incumbent
- script is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
+
+
If the global object specified by the incumbent
+ script's settings object is a WorkerGlobalScope
object (i.e. we are creating a nested worker),
add worker global scope to the list of the worker's workers of
- the WorkerGlobalScope
object that is the global object of the incumbent script.
+ the WorkerGlobalScope
object that is the global object of the incumbent script's settings object.
-
-
Run a worker for the resulting absolute URL, with the
- script's browsing context of the incumbent script as the owner browsing context, with the script's document of the
- incumbent script as the owner document, with the
- origin of the entry script as the owner origin,
- and with worker global scope as the global scope.
+ Run a worker for the script with URL worker
+ URL, the script settings object settings object, and the
+ origin of the entry script as the owner
+ origin.
@@ -91379,7 +91590,7 @@ interface SharedWorker : EventTarget {
-
Let docs be the list of relevant Document
objects to
- add given the global object of the
+ add given the settings object of the
incumbent script.
@@ -91394,8 +91605,9 @@ interface SharedWorker : EventTarget {
SharedWorkerGlobalScope
object. Let this SharedWorker
object be worker.
- Create a new MessagePort
object owned by the global object of the incumbent script. Let
+
+
Create a new MessagePort
object whose owner
+ is the settings object of the incumbent script. Let
this be the outside port.
Assign outside port to the SharedWorker : EventTarget {
Associate worker with worker global
scope.
- Create a new MessagePort
object owned by worker global scope. Let this be the inside port.
+ Let settings object be the script settings object
+ whose global object is worker global scope.
+
+
+ Create a new MessagePort
object whose owner
+ is settings object. Let this be the inside port.
Entangle outside port
and inside port.
@@ -91479,11 +91695,12 @@ interface SharedWorker : EventTarget {
-
-
If the global object of the incumbent
- script is a WorkerGlobalScope
object, add worker global
+
+ If the global object specified by the incumbent
+ script's settings object is a WorkerGlobalScope
object, add worker global
scope to the list of the worker's workers of the
- WorkerGlobalScope
object that is the global object of the incumbent script.
+ WorkerGlobalScope
object that is the global
+ object specified by the incumbent script's settings object.
@@ -91493,18 +91710,24 @@ interface SharedWorker : EventTarget {
+
+
Create a new SharedWorkerGlobalScope
object whose worker
origin is the origin of the entry script. Let worker global
scope be this new object.
+ Set up a worker script settings object with worker global
+ scope, and let settings object be the result.
+
Associate worker with worker global
scope.
Set the name
attribute of worker global scope to name.
- Create a new MessagePort
object owned by worker
- global scope. Let inside port be this new object.
+
+ Create a new MessagePort
object whose owner is settings object.
+ Let inside port be this new object.
Entangle outside port and inside
port.
@@ -91536,22 +91759,21 @@ interface SharedWorker : EventTarget {
-
-
If the global object of the incumbent
- script that invoked the constructor is a WorkerGlobalScope
object, add
+ If the global object specified by the settings object of the incumbent
+ script is a WorkerGlobalScope
object, add worker global scope to the list of the worker's workers of the
- WorkerGlobalScope
object that is the global
- object of the incumbent script.
+ WorkerGlobalScope
object that is the global
+ object specified by the incumbent script's settings object.
-
-
Run a worker for scriptURL, with the script's browsing
- context of the incumbent script as the owner browsing
- context, with the script's document of the incumbent script the
- owner document, with the origin of the entry
- script as the owner origin, and with worker global
- scope as the global scope.
+ Run a worker for the script with URL scriptURL, the script settings object settings
+ object, and the origin of the entry script as the owner origin.
@@ -91594,16 +91816,20 @@ interface SharedWorker : EventTarget {
If there are no arguments, return without doing anything. Abort these steps.
+ Let settings object be the script settings object of the
+ incumbent script.
+
Resolve each argument.
If any fail, throw a SyntaxError
exception and abort these steps.
-
+
Attempt to fetch each resource identified by the resulting absolute URLs, from the entry script's
- origin, using the entry script's referrer source, and with the synchronous flag set.
@@ -91634,16 +91860,14 @@ interface SharedWorker : EventTarget {
-
-
Create a script, using source as the script source, the
- URL from which source was obtained, and language as the scripting language, using the same global object, browsing
- context, document, referrer source, URL character encoding, and base URL as the script that was created by the worker's run a
- worker algorithm.
+ Create a script using source as the script source, the
+ URL from which source was obtained, language as the scripting language, and settings object as
+ the script settings object.
If the script came from a resource whose URL does not have the same
origin as the worker origin, then pass the muted
- errors flag to the create a script from a node algorithm.
+ errors flag to the create a script algorithm as well.
Let the newly created script run until it either
returns, fails to parse, fails to catch an exception, or gets prematurely aborted by the
@@ -105612,7 +105836,7 @@ if (s = prompt('What is your name?')) {
- None of the elements in the
Document
are in any of the following namespaces: HTML namespace, SVG namespace, MathML namespace
- The
Document
has no focusable elements (e.g. from XLink).
- The
Document
has no hyperlinks (e.g. from XLink).
- - There exists no script whose document is this
Document
.
+ - There exists no script whose settings object specifies this
Document
as the responsible document.
- None of the elements in the
Document
have any registered event listeners.