[whatwg/dom] AbortSignal.any() assertion failure (Issue #1293)

### What is the issue with the DOM Standard?

In Gecko [Bug 1903676](https://bugzilla.mozilla.org/show_bug.cgi?id=1903676), a test case was found where the assertion in [create a dependent abort signal](https://dom.spec.whatwg.org/#create-a-dependent-abort-signal) step 4.2.1. does not hold. I believe this is a spec issue.

Here is the example
```
let a = new AbortController();
let b = AbortSignal.any([a.signal]);
a.signal.addEventListener("abort", () => {
  AbortSignal.any([b]);
  console.log(b.aborted, a.signal.aborted);  // false, true
})
a.abort();
```
During the abort event of `a`, we create a dependent signal from `b`, which is not yet aborted. If `b` is not aborted and dependent on `a`, the spec expects `a` to be not aborted too and asserts this. The problem is that [signal abort](https://dom.spec.whatwg.org/#abortsignal-signal-abort) fires the event before aborting the dependent signals, steps 5 and 6 of signal abort could be switched to resolve this issue.

@shaseley 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1293
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1293@github.com>

Received on Thursday, 20 June 2024 07:26:36 UTC