From dcfaadcc246c43f189574387b2b71e1b8b729961 Mon Sep 17 00:00:00 2001
From: Domenic Denicola select
element, and then fire a simple
event that bubbles named change
at the
select
element, using the user interaction task source as the task
- source. If the stack of script settings objects was not empty when the user agent was
- to send select
update notifications, then the resulting JavaScript execution context stack was not empty when the user agent
+ was to send
select
update notifications, then the resulting input
and change
events must not be
trusted.
The last few pieces of state are the script block's
- type, the script block's character
- encoding, and the script block's
- fallback character encoding. They are determined when the script is prepared, based on
- the attributes on the element at that time, and the
- script
element's node document.
The last few pieces of state are the script block's
+ character encoding, and the
+ script block's fallback character encoding. They are determined when the script is
+ prepared, based on the attributes on the element at that time, and the script
+ element's node document.
When a script
element that is not marked as being "parser-inserted"
experiences one of the events listed in the following list, the user agent must immediately
@@ -59220,19 +59225,18 @@ dictionary RelatedEventInit : EventInit {
-
...let the script block's type for this
- script
element be "text/javascript
".
...let the script block's type for this script
element be
+ "text/javascript
".
Otherwise, if the script
element has a type
attribute, let the
- script block's type for this script
element be the value of that attribute
- with any leading or trailing sequences of space characters
- removed.
script
element be the value of that attribute with any leading or trailing
+ sequences of space characters removed.
Otherwise, the element has a non-empty language
- attribute; let the script block's type for this
- script
element be the concatenation of the string "text/
"
- followed by the value of the language
attribute.
script
element be the
+ concatenation of the string "text/
" followed by the value of the language
attribute.
@@ -59240,13 +59244,9 @@ dictionary RelatedEventInit : EventInit {
conforming, and is always ignored if there is a type
attribute present.
-
-
- If the user agent does not support the scripting language given by the script block's type for this script
element,
- then the user agent must abort these steps at this point. The script is not executed.
If the script block's type for this script
element is not
+ "text/javascript
", then the user agent must abort these steps at this
+ point. No script is executed.
If the specification for the script block's - type gives specific rules for decoding files in that format to Unicode, follow - them, using character encoding as the character encoding specified by - higher-level protocols, if necessary.
- -Otherwise, decode the file to Unicode, using character
+ Decode the file to Unicode, using character
encoding as the fallback encoding. The decode algorithm overrides character
@@ -59643,19 +59637,7 @@ dictionary RelatedEventInit : EventInit {
The external file is the script source. When it is later executed, it must be - interpreted in a manner consistent with the specification defining the language given by - the script block's type.
- -The child nodes of the script
element at the time the element's
- "already started" flag was last set are the script source.
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 environment settings object of the script
element's
- node document's Window
object.
script
element's node
+ 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 @@ -59890,15 +59861,6 @@ o............A....e
A user agent is said to support the scripting language if each component of the script block's type is an ASCII - case-insensitive match for the corresponding component in the MIME type string - of a scripting language that the user agent implements.
- -A JavaScript MIME type is a MIME type string that is one of the following and refers to JavaScript:
@@ -59928,7 +59890,8 @@ o............A....eUser agents may support other MIME types for other languages, but must not support other MIME types for the languages in the list - above. User agents are not required to support the languages listed above.
+ above. User agents are not required to support JavaScript. The processing model for languages + other than JavaScript is outside the scope of this specification.The following MIME types (with or without parameters) must not be interpreted as scripting languages:
@@ -77557,6 +77520,9 @@ dictionary DragEventInit : MouseEventInit { navigations occur.Save the JavaScript execution context created as realm execution + context.
Do not obtain any source texts for scripts or modules.
Document
to document.
Set up a browsing context environment settings object with - window.
Create a script, using script source as the script
- source, address as the script source URL, JavaScript as the scripting
- language, and the environment settings object of the Window
object of
- the active document of the browsing context being navigated.
Window
object of the active document of the
+ browsing context being navigated.
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 1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O
Set window's associated
Let settings object be the environment settings object
+ created for the browsing context. Set settings object's global object to
+ window.Document
to the new Document
.
A code entry-point represents a block of executable code that the script exposes to other - scripts and to the user agent. Typically, the code corresponding to the code entry-point is - executed immediately after the script is parsed, but for event handlers, it is called each time - the handler is invoked.
- -In JavaScript script
blocks, this corresponds to the execution
- context of the global code.
A code entry-point is either a string containing a block of executable code to be evaluated, + or a JavaScript function object. The latter case is used for event handlers.
The characteristics of the script execution environment depend on the language, and are not - defined by this specification.
- -In JavaScript, the script execution environment consists of the interpreter,
- the stack of execution contexts, the global code and function code and the
- Function
objects resulting, and so forth.
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 or a
- WorkerGlobalScope
object. When a global object is an empty object, it
- can't do anything that interacts with the environment.
A JavaScript execution context shared by all + scripts that use this settings object, i.e. all scripts in a given + realm. When we jump to a code-entry point, this execution context becomes the + top of the JavaScript execution context stack, on top of which another execution + context specific to the script in question is pushed. (This setup ensures ParseScript and EvaluateScript knows which realm to use.)
A JavaScript execution context's global object is its Realm component's [[globalObject]] field. An environment + settings object's global object is the global object of its realm execution context.
+ +This is typically a Window
object or a
+ WorkerGlobalScope
object.
The relevant settings object for a global object o is the environment settings object whose global object is o. (There is always a 1:1 mapping of global objects to environment settings objects.)
@@ -85939,39 +85902,34 @@ interface NavigatorOnLine {The relevant settings object for a script s is the settings object of s.
+The script corresponding to the running execution context is the + script in the [[HostDefined]] slot of the running JavaScript execution + context's ScriptOrModule.
When the user agent is required to set up a browsing context environment settings - object, given a window, it must run the following steps:
+ object, given a JavaScript execution context execution context, it + must run the following steps:Let url be a copy of the address
of the Document
with which window associated.
Let window be execution context's global object.
Let settings object be a new environment settings object whose algorithms are defined as follows:
When the environment 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 environment settings object was created.
- -Return window.
+Return execution context.
Each unit of related similar-origin browsing contexts has a stack of script - settings objects, which must be initially empty. When a new environment settings - object is pushed onto this stack, the specified environment settings object - is to be added to the stack; when the environment settings object on this stack that was - most recently pushed onto it is to be popped from the stack, it must be removed. Entries on - this stack can be labeled as candidate entry - settings objects.
-When a user agent is to jump to a code entry-point for a script s, the user agent must run the following steps:
Let context be the settings object of s.
Let settings be the settings object of s.
Prepare to run a callback with context as the - environment settings object. If this returns "do not run" then abort these - steps.
Assert: s's code entry-point is a string of source text; this + algorithm should never be reached when it is a function.
Make the appropriate script execution environment specified by context execute the s's code - entry-point.
Prepare to run a callback with settings. If this returns "do not + run" then abort these steps.
Let result be ParseScript(s's + code entry-point, s).
If result is a List of errors, report the exception given by the + first element in result for the script s, and go to the step labeled + cleanup.
Let status be ScriptEvaluation(result).
Clean up after running a callback.
If status is an abrupt completion, report the exception given by + result.[[value]] for the script s.
Cleanup: Clean up after running a callback with + settings.
If result exists and is not an abrupt completion, return + result.[[value]]. Otherwise, script execution was unsuccessful, either because an + error occurred during parsing, or an exception occurred during evaluation, or because it was + aborted prematurely.
The steps to prepare to run a callback with an environment settings object - o are as follows. They return either "run" or "do not run".
+ settings are as follows. They return either "run" or "do not run".If the global object specified by o is a +
If the global object specified by settings 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 the - responsible browsing context specified by o, then return "do + responsible browsing context specified by settings, then return "do not run" and abort these steps.
-Push o onto the stack of script settings objects, and - label it as a candidate entry settings object.
Label settings as a candidate entry settings object.
Assert: the JavaScript execution context stack is currently empty.
Push settings's realm execution context onto the JavaScript + execution context stack; it is now the running JavaScript execution + context.
Return "run".
The steps to clean up after running a callback are as follows:
+The steps to clean up after running a callback with an environment settings + object settings are as follows. are as follows:
Pop the current incumbent settings object from the stack of script - settings objects.
Stop labeling settings as a candidate entry settings + object.
Assert: settings's realm execution context is the running + JavaScript execution context.
Remove settings's realm execution context from the + JavaScript execution context stack.
If the stack of script settings objects is now empty, run the global
+ If the JavaScript execution context stack is now empty, run the global
script clean-up jobs. (These cannot run scripts.) If the stack of script settings objects is now empty, perform a
+ If the JavaScript execution context stack is now empty, perform a
microtask checkpoint. (If this runs scripts, these algorithms will be invoked
reentrantly.) When a JavaScript SourceElements production is to be evaluated, the settings
- object of the script corresponding to that
- SourceElements must be pushed onto the stack of script settings objects before
- the evaluation begins, and popped when the evaluation ends (regardless of whether it's an abrupt
- completion or not). A JavaScript execution context's settings object is the
+ settings object of the script in the [[HostDefined]] slot in the
+ ScriptOrModule component of the given JavaScript execution context. The entry settings object is the most-recently added environment settings
- object in the stack of script settings objects that is labeled as a
- candidate entry settings object. If the stack is empty, or has no entries labeled as
- such, then there is no entry settings object. It is used to obtain, amongst other
- things, the API base URL to resolve relative
- URLs used in scripts running in that unit of related
- similar-origin browsing contexts. The entry settings object is the settings object of the topmost entry in the JavaScript execution
+ context stack whose settings object is labeled as a candidate entry settings object. The incumbent settings object is the environment settings object in the
- stack of script settings objects that was most-recently added (i.e. the last one on
- the stack). If the stack is empty, then there is no incumbent settings object. It is
- used in some security checks. The incumbent settings object is determined as follows: Let scriptOrModule be the result of JavaScript's GetActiveScriptOrModule() abstract
+ operation. If scriptOrModule is null, abort these steps; there is no
+ incumbent settings object. Return the settings object of the script in
+ scriptOrModule's [[HostDefined]] internal slot. The entry settings object is used to obtain, amongst other things, the API
+ base URL to resolve relative
+ URLs used in scripts running in that unit of related
+ similar-origin browsing contexts. The Web IDL specification also uses these algorithms. The incumbent settings object is used in some security checks. The When the specification says that a script is to be created, given some script source, a script source URL, its
- scripting language, an environment settings object, and optionally a muted
- errors flag, the user agent must run the following steps: Obtain the appropriate script execution environment for the given scripting
- language from the environment settings object provided. Parse/compile/initialise 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 script's code entry-point to the supplied script
+ source. Let script's settings object be the environment
settings object provided. If the muted errors flag was set, then set script's muted errors flag. If the muted errors flag was set, then set script's muted
+ errors flag. If all the steps above succeeded (in particular, if the script was compiled successfully),
- Jump to script's code
- entry-point. Otherwise, report the error for script, with the
- problematic position (line number and column number), using the global object
- specified by the environment settings object as the target. If the error is still not handled after this, then the error may be reported to
- a developer console. Jump to script's code
+ entry-point. When an exception is thrown during the execution of one of the scripts associated with a
- Let script be the script corresponding
- to the running execution context. Let script be the script corresponding to the running execution
+ context. If script has muted errors, terminate these steps. Let task source be task's task
source. Let old stack of script settings objects be a copy of the stack
- of script settings objects. Let old stack be a copy of the JavaScript execution context
+ stack. Empty the stack of script settings objects. Empty the JavaScript execution context stack. Run the global script clean-up jobs. Replace the stack of script settings objects with the old
- stack of script settings objects. Replace the JavaScript execution context stack with the old
+ stack. Return to the caller. Obtain the script execution environment for JavaScript from script settings. If body is not parsable as FunctionBody
@@ -87506,8 +87469,7 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEvent
Using the script execution environment obtained above, let
- function be the result of calling Let function be the result of calling FunctionCreate, with arguments: For the global Save the JavaScript execution context created as realm execution
+ context. Do not obtain any source texts for scripts or modules. Set window's associated
Set up a browsing context environment settings object with
- top-level execution context. Set up a browsing context environment settings object with realm
+ execution context. Create a script using script source as the script source,
- the URL where script source can be found, scripting
- language as the scripting language, and settings object as the
- environment settings object. For the global object, if is shared is true, create a new
- For the global object, if is shared is true, create a new
+ Set up a worker environment settings object with worker global
- scope, and let settings object be the result. Save the JavaScript execution context created as realm execution
+ context. Do not obtain any source texts for scripts or modules. Set up a worker environment settings object with realm execution
+ context, and let settings object be the result. Associate worker with worker global scope. Create a new Create a new Let script be a new script. Obtain the appropriate script execution environment for the scripting language
- language from settings object. Parse/compile/initialise source using that script execution
- environment, as appropriate for language, and thus obtain a code
- entry-point. If the script was not compiled successfully, let the code
- entry-point be a no-op script, and act as if a corresponding uncaught script error had
- occurred. Let script's settings object be settings object. Closing orphan workers: Start monitoring the worker such that no sooner than
@@ -95542,13 +95490,19 @@ interface WorkerGlobalScope : EventTarget {
Let script be a new script with
+ code entry-point source and settings object settings
+ object. Jump to the script's code entry-point, and let that run until it
- either returns, fails to catch an exception, or gets prematurely aborted by the "kill a
- worker" or "terminate a worker" algorithms defined below. In addition to the usual possibilities of returning a value or failing due to
+ an exception, this could be prematurely aborted by the "kill a worker" or
+ "terminate a worker" algorithms defined below. Enable outside port's port message queue. When the user agent is required to set up a worker environment settings object,
- given a worker global scope, it must run the following steps: Let worker event loop be a newly created event
loop. Let worker global scope be execution context's
+ global object. Let settings object be a new environment settings object whose algorithms
@@ -95748,18 +95706,10 @@ interface AbstractWorker {
When the environment 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 environment settings object was created. Currently, workers only support JavaScript, so only a JavaScript execution
- environment is actually needed here. Return execution context.
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
+ URL from which source was obtained, and settings object as
the environment settings object. If response is CORS-cross-origin, pass the muted errors
@@ -104749,7 +104699,8 @@ document.body.appendChild(text);
If the stack of script settings objects is empty, perform a microtask checkpoint. If the JavaScript execution context stack is empty, perform a microtask
+ checkpoint. Let script be the current node (which will be a
+
+
+ hello()
function is running, the entry settings
object is that of the outer file (a/a.html
), and the
incumbent settings object is that of the inner file (b/b.html
). The assign()
method uses
- the entry settings object to resolve the URL, so we end up loading a/c.html
, but it uses the incumbent settings object to establish
- the source browsing context, from which the referrer is established, so the `b/b.html
).
+
+ assign()
method uses the entry settings
+ object to resolve the URL, so we end up loading a/c.html
, but it
+ uses the incumbent settings object to establish the source browsing
+ context, from which the referrer is established, so the `Referer
` header sent with the request for a/c.html
specifies the inner file's URL (the one ending with b/b.html
).Creating scripts
@@ -86210,30 +86201,17 @@ 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.
-
@@ -86371,10 +86349,6 @@ interface NavigatorOnLine {
data-x="concept-error-nothandled">not handled after this, then the error may be reported to
the user.
- Document
, and the exception is not caught, the user agent must report the
- exception.The
@@ -86498,15 +86472,8 @@ dictionary ErrorEventInit : EventInit {
ErrorEvent
interface
-
@@ -95449,21 +95413,22 @@ interface WorkerGlobalScope : EventTarget {
operation with the following customizations:
Events
Event handlers
@@ -87470,9 +87436,6 @@ typedef OnBeforeUnloadEventHandlerNonNull? OnBeforeUnloadEvent
created for the Window
object with which document is
currently associated.
-
@@ -88288,6 +88250,9 @@ interface WindowBase64 {
this
value, use the current browsing
context's associated WindowProxy
.Document
to the Document
.
-
+ SharedWorkerGlobalScope
object. Otherwise, create a new
- DedicatedWorkerGlobalScope
object. Let worker global scope be the
- created object.SharedWorkerGlobalScope
object. Otherwise, create a new
+ DedicatedWorkerGlobalScope
object. Let worker global scope be the
+ created object.MessagePort
object whose WorkerGlobalScope : EventTarget {
WorkerLocation
object and associate it with worker global
scope.Script settings for workers
@@ -95741,6 +95696,9 @@ interface AbstractWorker {
-
script
element).