diff --git a/source b/source index aab7fb01790..1d6fc9eca39 100644 --- a/source +++ b/source @@ -3048,13 +3048,13 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
When Web IDL is used to invoke author - code, or when EnqueueJob invokes a promise job, they use the following algorithms to - track relevant data for determining the incumbent settings object:
+ code, or when HostEnqueuePromiseJob invokes a promise job, they use the following + algorithms to track relevant data for determining the incumbent settings object:To prepare to run a callback with an environment settings object settings:
@@ -89466,39 +89466,14 @@ document.querySelector("button").addEventListener("click", bound); user with a mechanism to just close the page entirely, without running anyunload
event handlers.
- The JavaScript specification defines the JavaScript job and job queue abstractions in order to - specify certain invariants about how promise operations execute with a clean JavaScript - execution context stack and in a certain order. However, as of the time of this writing - the definition of EnqueueJob in that specification is not - sufficiently flexible to integrate with HTML as a host environment.
- -This is not strictly true. It is in fact possible, by taking liberal advantage of - the many "implementation defined" sections of the algorithm, to contort it to our purposes. - However, the end result is a mass of messy indirection and workarounds that essentially bypasses - the job queue infrastructure entirely, albeit in a way that is technically sanctioned within the - bounds of implementation-defined behavior. We do not take this path, and instead introduce the - following willful violation.
- -As such, user agents must instead use the following definition in place of that in the - JavaScript specification. These ensure that the promise jobs enqueued by the JavaScript - specification are properly integrated into the user agent's event - loops.
- -The RunJobs abstract operation from the JavaScript specification must - not be used by user agents.
- -When the JavaScript specification says to call the EnqueueJob abstract operation, the - following algorithm must be used in place of JavaScript's EnqueueJob:
+JavaScript contains an implementation-defined HostEnqueuePromiseJob(pending) abstract + operation to schedule Promise-related operations. HTML schedules these operations in the microtask + queue. User agents must use the following implementation:
Assert: queueName is "PromiseJobs"
. ("ScriptJobs"
must not be used by user agents.)
Let job settings be some appropriate environment settings object.
@@ -89551,7 +89526,8 @@ document.querySelector("button").addEventListener("click", bound); handler will be created by the get the current value of the event handler algorithm, which creates a function with null [[ScriptOrModule]] value. Thus, when the promise machinery calls - EnqueueJob, there will be no active script to pass along. + HostEnqueuePromiseJob, there will be no active script to pass + along.As a consequence, this means that when the import()
expression is evaluated,
there will still be no active script. Fortunately that is handled by our
@@ -89593,7 +89569,8 @@ document.querySelector("button").addEventListener("click", bound);
Let result be the result of performing the abstract operation specified by - job, using the elements of arguments as its arguments.
If script execution context is not null, then pop script execution context from the JavaScript execution context