diff --git a/source b/source index 01a93e619a2..5e79d3f0b0b 100644 --- a/source +++ b/source @@ -2942,6 +2942,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
[Global][PropagatesAsyncContext][LegacyFactoryFunction][LegacyLenientThis][LegacyNullToEmptyString]User agents that support JavaScript must also implement the AsyncContext proposal. + The following terms are defined there, and used in this specification: JSASYNCCONTEXT
+ +template element
section.
+
+
+
+ To run an + algorithm steps with an Async Context Mapping mapping: + JSASYNCCONTEXT
+ +Let previousMapping be + AsyncContextSwap(mapping).
Let returnValue be the result of running steps. If this throws an + exception e, then:
+ +Perform AsyncContextSwap(previousMapping).
Throw e.
Perform AsyncContextSwap(previousMapping).
Return returnValue.
Specifications should not use the AsyncContextSwap abstract operation defined in + JSASYNCCONTEXT, or otherwise set or mutate an agent record's [[AsyncContextMapping]] + field. Instead they should run an algorithm with + an Async Context Mapping, which properly cleans up after itself.
+ @@ -66678,6 +66723,10 @@ o............A....eA script element has a delaying the
load event boolean, initially false.
A script element has an execution Async Context Mapping, which is
+ either null or an Async Context Mapping, initially null. It is used so async-local
+ state from the script preparation is available when the script is executed.
A script element has a type, which is
either null, "classic", "module", "importmap", or "speculationrules", initially null. It is
@@ -67184,6 +67233,9 @@ document.body.append(script1, script2);
+
Set el's execution Async Context Mapping to + AsyncContextSnapshot().
If el does not have a src content
attribute:
script element el:
Let document be el's node document.
Assert: el's execution Async Context Mapping is not + null.
If el's preparation-time document is not equal to - document, then return.
Run the following steps with + el's execution Async Context Mapping:
-Unblock rendering on el.
In the case where prepare the script element + immediately invoked this algorithm, this does not change the current Async + Context Mapping.
-If el's result is null, then fire an event named error
- at el, and return.
Set el's execution Async Context Mapping to null.
If el's from an external file is
- true, or el's type is "module", then increment document's ignore-destructive-writes
- counter.
Let document be el's node document.
Switch on el's type:
+If el's preparation-time document is not equal to + document, then return.
classic"Let oldCurrentScript be the value to which document's currentScript object was most recently
- set.
Unblock rendering on el.
If el's root is not a shadow root, then
- set document's currentScript
- attribute to el. Otherwise, set it to null.
This does not use the in a document tree check, as
- el could have been removed from the document prior to execution, and in that
- scenario currentScript still needs to
- point to it.
If el's result is null, then fire an event named error
+ at el, and return.
Run the classic script given by - el's result.
If el's from an external file is
+ true, or el's type is "module", then increment document's ignore-destructive-writes
+ counter.
Set document's currentScript attribute to
- oldCurrentScript.
Switch on el's type:
-module"Assert: document's currentScript attribute is null.
classic"Let oldCurrentScript be the value to which document's currentScript object was most recently
+ set.
Run the module script given by - el's result.
If el's root is not a shadow root, then
+ set document's currentScript
+ attribute to el. Otherwise, set it to null.
This does not use the in a document tree check, as
+ el could have been removed from the document prior to execution, and in that
+ scenario currentScript still needs to
+ point to it.
importmap"Register an import map given el's relevant global - object and el's result.
Run the classic script given by + el's result.
speculationrules"Register speculation rules given el's relevant global - object and el's result.
Set document's currentScript attribute to
+ oldCurrentScript.
Decrement the ignore-destructive-writes counter of document, if - it was incremented in the earlier step.
module"Assert: document's currentScript attribute is null.
Run the module script given by + el's result.
If el's from an external file is
- true, then fire an event named load at el.
importmap"Register an import map given el's relevant global + object and el's result.
speculationrules"Register speculation rules given el's relevant global + object and el's result.
Decrement the ignore-destructive-writes counter of document, if + it was incremented in the earlier step.
If el's from an external file is
+ true, then fire an event named load at el.
If blur event target is not null, fire a focus event
- named blur at blur event target, with
- related blur target as the related target.
If blur event target is not null:
+ +If blur event target's relevant agent is not the + surrounding agent, or if blur event target's relevant settings + object's origin is not + same origin with the current settings object's origin, then run the following steps with Async Context Mapping « ». + Otherwise, run the following steps:
+ +Fire a focus event named blur at
+ blur event target, with related blur target as the related
+ target.
Issue #3506: If + focus event target's relevant agent is not the surrounding agent, then the event + should be fired in a task in the relevant agent's event loop.
+ +In some cases, e.g., if entry is
an area element's shape, a scrollable region, or a viewport, no
@@ -85428,9 +85517,30 @@ dictionary CommandEventInit : EventInit {
focus target be null.
If focus event target is not null, fire a focus event
- named focus at focus event target, with
- related focus target as the related target.
If focus event target is not null:
+ +If focus event target's relevant agent is not the + surrounding agent, or if focus event target's relevant + settings object's origin is not + same origin with the current settings object's origin, then run the following steps with Async Context Mapping « ». + Otherwise, run the following steps:
+ +Fire a focus event named focus at
+ focus event target, with related focus target as the related
+ target.
Issue #3506: If + focus event target's relevant agent is not the surrounding agent, then the event + should be fired in a task in the relevant agent's event loop.
+ +In some cases, e.g. if entry is an area
element's shape, a scrollable region, or a viewport, no event is fired.
While the event loop's microtask queue is not empty:
+Run the following steps with Async + Context Mapping « »:
Let oldestMicrotask be the result of dequeuing - from the event loop's microtask queue.
While the event loop's microtask queue is not empty:
-Set the event loop's currently running task to - oldestMicrotask.
Let oldestMicrotask be the result of dequeuing + from the event loop's microtask queue.
Run oldestMicrotask.
+Set the event loop's currently running task to + oldestMicrotask.
Run oldestMicrotask.
-This might involve invoking scripted callbacks, which eventually calls the - clean up after running script steps, which call this perform a microtask - checkpoint algorithm again, which is why we use the performing a microtask - checkpoint flag to avoid reentrancy.
+This might involve invoking scripted callbacks, which eventually calls the + clean up after running script steps, which call this perform a microtask + checkpoint algorithm again, which is why we use the performing a microtask + checkpoint flag to avoid reentrancy.
+Set the event loop's currently running task back to + null.
Set the event loop's currently running task back to - null.
For each environment settings object settingsObject whose + responsible event loop is this event loop, notify about rejected + promises given settingsObject's global object.
For each environment settings object settingsObject whose - responsible event loop is this event loop, notify about rejected - promises given settingsObject's global object.
Cleanup Indexed Database transactions.
Let uniqueHandle be null.
Let savedAsyncContextMapping be AsyncContextSnapshot().
Let task be a task that runs the following - substeps:
+Let task be a task that runs the following steps with the Async Context Mapping + savedAsyncContextMapping:
Assert: uniqueHandle is a unique internal value, @@ -127680,7 +127800,7 @@ loadMySprites().then(runDemo);
callback FrameRequestCallback = undefined (DOMHighResTimeStamp time);
interface mixin AnimationFrameProvider {
- unsigned long requestAnimationFrame(FrameRequestCallback callback);
+ unsigned long requestAnimationFrame([PropagatesAsyncContext] FrameRequestCallback callback);
undefined cancelAnimationFrame(unsigned long handle);
};
Window includes AnimationFrameProvider;
@@ -155976,6 +156096,9 @@ INSERT INTERFACES HERE
- [JPEG]
- JPEG File Interchange Format, E. Hamilton.
+ - [JSASYNCCONTEXT]
+ - AsyncContext. Ecma International.
+
- [JSERRORSTACKS]
- (Non-normative) Error Stacks. Ecma International.