diff --git a/dom.bs b/dom.bs index 5e04fed6..b07dcd9c 100644 --- a/dom.bs +++ b/dom.bs @@ -1729,6 +1729,8 @@ interface AbortController { [SameObject] readonly attribute AbortSignal signal; undefined abort(optional any reason); + + undefined close(); }; @@ -1745,6 +1747,13 @@ interface AbortController { [=AbortSignal/abort reason=], and signal to any observers that the associated activity is to be aborted. If reason is undefined, then an "{{AbortError!!exception}}" {{DOMException}} will be stored. + +
controller . close() +
Invoking this method will set this object's {{AbortSignal}}'s [=AbortSignal/closed] to + true, indicating that the {{AbortController}} is abandoning the {{AbortSignal}} and + will not signal to any observers that associated activity is to be aborted. As a result, the { + {AbortSignal}} will Remove all event listeners whose set of event types to handle contains + abort.

An {{AbortController}} object has an associated signal (an @@ -1767,6 +1776,8 @@ constructor steps are: to signal abort on this's signal with reason if it is given. +

The signal close on this's closed +

Returns true if this {{AbortSignal}}'s {{AbortController}} has signaled to close; otherwise + false. +
signal . reason
Returns this {{AbortSignal}}'s abort reason. @@ -1799,6 +1815,9 @@ JavaScript value. It is undefined unless specified otherwise.

An {{AbortSignal}} object is aborted when its [=AbortSignal/abort reason=] is not undefined. +

An {{AbortSignal}} object is closed when its +[=AbortSignal/closed=] is true. +

An {{AbortSignal}} object has associated abort algorithms, which is a set of algorithms which are to be executed when it is [=AbortSignal/aborted=]. Unless specified otherwise, its value is the empty set. @@ -1809,6 +1828,8 @@ object signal, run these steps:

  1. If signal is [=AbortSignal/aborted=], then return. +

  2. If signal is [=AbortSignal/closed=], then return. +

  3. Append algorithm to signal's abort algorithms.

@@ -1837,6 +1858,9 @@ are:

The aborted getter steps are to return true if this is [=AbortSignal/aborted=]; otherwise false. +

The closed getter steps are to return true if this +is [=AbortSignal/closed=]; otherwise false. +

The reason getter steps are to return this's abort reason. @@ -1855,6 +1879,8 @@ them. For instance, if the operation has already completed.

  1. If signal is [=AbortSignal/aborted=], then return. +

  2. If signal is [=AbortSignal/closed=], then return. +

  3. Set signal's [=AbortSignal/abort reason=] to reason if it is given; otherwise to a new "{{AbortError!!exception}}" {{DOMException}}. @@ -1866,6 +1892,23 @@ them. For instance, if the operation has already completed.

  4. [=Fire an event=] named {{AbortSignal/abort}} at signal.

+

To signal close, given an {{AbortSignal}} object +signal, run these steps: + +

    +
  1. If signal is [=AbortSignal/aborted=], then return. + +

  2. If signal is [=AbortSignal/closed=], then return. + +

  3. Set signal's [=AbortSignal/closed=] to true. + +

  4. Remove all of signal's abort algorithms. +

+ +

Closing an {{AbortSignal}} enables explicitly indicating that there is no further +reason to expect the {{AbortController}} to signal abort on its +{{AbortSignal}}, and that the signal can be safely ignored. +

A followingSignal (an {{AbortSignal}}) is made to follow a parentSignal (an {{AbortSignal}}) by running these steps: @@ -1873,6 +1916,11 @@ these steps:

  1. If followingSignal is [=AbortSignal/aborted=], then return. +

  2. If followingSignal is [=AbortSignal/closed=], then return. + +

  3. If parentSignal is [=AbortSignal/closed=], then + signal close on followingSignal. +

  4. If parentSignal is [=AbortSignal/aborted=], then signal abort on followingSignal with parentSignal's [=AbortSignal/abort reason=].