How to turn "the spec says" into a claim you can test: read the Web IDL, the numbered steps and the event-loop vocabulary, then find the WPT subtest that pins each step.
Contents · 10 sections
Somebody in a design review says "AbortSignal.any() returns an already-aborted signal if any of its inputs is aborted, so we don't need the early check." Somebody else says "I'm not sure that's guaranteed." Both of them then paste a link to MDN, and the argument stalls, because neither link settles it. The question isn't what the API usually does. It's what the platform promises, in which scopes, in which engines, and how we'd know if one of them broke the promise.
"The spec says so" is the obvious answer, and it's incomplete. Specs are written in a dialect. A WebIDL line decides what happens before the first numbered step runs. A numbered step can say "in parallel", "queue a global task" or "implementation-defined", and each of those changes what a test can observe. The claim in the review is roughly right, but the precise version has three extra clauses (which reason you get, what kind of signal comes back, and that nothing about it depends on timing), and one of those clauses isn't pinned by any test I could find.
This piece is a method for turning "the spec says" into a claim you can test. It reads one small algorithm, AbortSignal.any(), all the way from its IDL to the subtests that exercise each step, and borrows a few neighbors from Streams and HTML where they teach something any() can't. It's the third part of the "Reading the platform" series, after what Baseline actually guarantees and how a web feature becomes real. Every spec anchor, test file and result here was checked on October 18, 2026.
A testable claim names the step, the scope and the engines
Start by writing the claim down the way a test would assert it. "AbortSignal.any() returns an already-aborted signal if any input is aborted" is a sentence. A testable claim looks more like this: given a list of signals where at least one is already aborted, AbortSignal.any(list) returns a new signal whose aborted is true and whose reason is the reason of the first aborted signal in list order; this holds in window and dedicated worker scopes; and the latest stable Chrome, Edge, Firefox and Safari all pass the subtests that cover it.
Each clause points somewhere specific. "Returns a new signal" comes from the IDL. "First in list order" comes from one numbered step. "Window and worker" comes from the IDL's [Exposed] attribute and from how the test file is named. "Stable Chrome, Edge, Firefox and Safari" comes from wpt.fyi, read the right way. If you can't point to a source for a clause, the clause goes in a "what we don't know" list, not in the review comment.
Here is where each part lives. The DOM Standard's AbortSignal IDL declares the method. The method steps for any() are a single sentence that delegates to an internal algorithm, create a dependent abort signal. The tests are in dom/abort/ in Web Platform Tests. The rest of this article walks that path in order: IDL, steps, vocabulary, tests, types.
One note on dating. The DOM Standard I read carries a "Last Updated" of 16 October 2026. WHATWG Living Standards change continuously, and the WHATWG Working Mode only says editors "should try to preserve anchors when reasonable", with commit snapshots for anyone who needs to cite exactly what a standard said on a given day. So a claim that matters should carry the date you read it, and if it's going into a decision record, a snapshot link.
Web IDL decides what happens before step 1
The IDL block at the top of an interface section is not decoration. It's a contract that the Web IDL Standard turns into JavaScript behavior: argument conversion, this checks, and what happens to exceptions. A lot of "the API threw" versus "the API rejected" arguments are settled here, before the prose steps run at all.
The AbortSignal IDL, as of today, reads (with the long timeout() line wrapped):
[Exposed=*]
interface AbortSignal : EventTarget {
[NewObject] static AbortSignal abort(optional any reason);
[Exposed=(Window,Worker), NewObject]
static AbortSignal timeout([EnforceRange] unsigned long long milliseconds);
[NewObject] static AbortSignal _any(sequence<AbortSignal> signals);
readonly attribute boolean aborted;
readonly attribute any reason;
undefined throwIfAborted();
attribute EventHandler onabort;
};Three details in it carry testable meaning.
The underscore in _any is escaping, not a private method
any is a keyword in Web IDL (it's the "any JavaScript value" type), so the DOM Standard writes the operation as _any. The Web IDL section on names says that for these constructs "the identifier is the value of the identifier token with any leading U+005F (_) removed", and that the underscore exists "to escape an identifier from looking like a reserved word". The JavaScript method is AbortSignal.any. I mention it because the first time you grep a spec for an IDL member and find nothing, this is often why.
Extended attributes are behavior
[NewObject] means "a reference to a newly created object must always be returned", which is why the WPT subtest "follows a single signal" asserts that any([signal]) is not the same object as signal. [EnforceRange] on timeout() changes number conversion. Under ConvertToInt, a value with [EnforceRange] that is NaN or infinite throws a TypeError, and so does one outside the type's range after truncation. For unsigned long long the lower bound is 0, so AbortSignal.timeout(-1) should throw a TypeError per the spec.
That's a clean, testable claim, and it's a good example of why "the spec says" and "an implementation does" are different sentences. I ran this in Node 24.18.0:
try {
AbortSignal.timeout(-1);
} catch (error) {
// Web IDL says TypeError. Node 24.18.0 prints RangeError.
console.log(error.constructor.name);
}Node printed RangeError, with a message saying the delay must be between 0 and 4294967295. Node isn't a browser and isn't in the wpt.fyi run set I use below, so this says nothing about Chrome, Firefox or Safari. It does show that "throws" isn't precise enough: which error, from which conversion, is the claim. I didn't find a subtest for negative or infinite timeouts in timeout.any.js, which tests only that the returned signal starts unaborted, times out with a TimeoutError, and that timeouts fire in order. Whether the browsers agree with the spec here is in the last section.
sequence<AbortSignal> means any iterable, and [Exposed] sets the scopes
The argument type is a sequence, not an array. The Web IDL sequence conversion throws a TypeError if the value isn't an object, then looks up Symbol.iterator and iterates. So AbortSignal.any(new Set([controller.signal])) is valid, and passing a single signal instead of a list throws. I confirmed both in Node 24.18.0. That will matter again when we get to TypeScript, because its declaration says AbortSignal[].
[Exposed=*] on the interface puts AbortSignal in every global scope; timeout() narrows itself to Window and Worker. That's the source for the "window and worker" clause, and it predicts which test variants exist.
Dictionaries have defaults, a lookup order, and members that may not exist
pipeTo() is a better teacher here than anything on AbortSignal, because it takes an options dictionary. The Streams Standard's StreamPipeOptions declares:
dictionary StreamPipeOptions {
boolean preventClose = false;
boolean preventAbort = false;
boolean preventCancel = false;
AbortSignal signal;
};Three members have defaults; signal has none. The dictionary conversion algorithm reads each member from the JavaScript object, and if the value is undefined and the member has a default, it uses the default. A member with no default and no value is absent from the IDL dictionary. That's why the pipeTo() method steps say "Let signal be options["signal"] if it exists, or undefined otherwise": the prose has to handle absence because the IDL allowed it.
The lesser-known rule is order. The Web IDL dictionaries section says members are ordered with inherited members first and then "lexicographically by the Unicode codepoints that comprise their identifiers", and the conversion walks them in that order. So the declaration order above is irrelevant: the binding reads preventAbort, then preventCancel, then preventClose, then signal. You can observe that with getters:
const touched = [];
const options = {
get preventClose() { touched.push('preventClose'); return false; },
get preventAbort() { touched.push('preventAbort'); return false; },
get signal() { touched.push('signal'); return undefined; },
get preventCancel() { touched.push('preventCancel'); return false; },
};
const source = new ReadableStream({ start(c) { c.close(); } });
await source.pipeTo(new WritableStream(), options);
console.log(touched.join(', '));In Node 24.18.0 that prints preventAbort, preventCancel, preventClose, signal, regardless of the order the getters are written in. More to the point, a browser test asserts the same thing.
Promise-returning operations reject instead of throwing
The create an operation function algorithm wraps everything in "Try running the following steps": the this check, overload resolution and argument conversion, and the method steps themselves. And then, "if an exception E was thrown: If op has a return type that is a promise type, then return ! Call(%Promise.reject%, %Promise%, «E»). Otherwise, end these steps and allow the exception to propagate."
So the same throwing getter produces two different behaviors depending on the return type. pipeTo() returns Promise<undefined>, so a getter that throws while the options are converted becomes a rejected promise. pipeThrough() returns a ReadableStream, so the same getter throws synchronously.
const options = {
get preventAbort() { throw new Error('preventAbort getter'); },
};
// Promise return type: no exception escapes, the promise rejects.
const piping = new ReadableStream().pipeTo(new WritableStream(), options);
piping.catch((error) => console.log('rejected:', error.message));
// Non-promise return type: the exception propagates.
try {
new ReadableStream().pipeThrough(new TransformStream(), options);
} catch (error) {
console.log('threw:', error.message);
}This isn't a Node quirk. WPT's streams/piping/throwing-options.any.js builds an options object whose getters record the order they're touched, makes each one throw in turn, and asserts that pipeTo rejects (promise_rejects_js) while pipeThrough throws (assert_throws_js), with ['preventAbort', 'preventCancel', 'preventClose', 'signal'] as the expected order. In the 2026-10-17 stable runs, that file passes 8 of 8 subtests in Chrome 155, Edge 155, Firefox 158 and Safari 27.0, in every scope it runs in. Two Web IDL rules, one test file, four engines. That's what a settled claim looks like.
The practical consequence for code review: wrapping a promise-returning platform call in try/catch without awaiting it catches nothing from argument conversion. Passing null as the destination of pipeTo fails the WritableStream conversion, and you get a rejected promise with a TypeError, not an exception at the call site.
Numbered steps are a program, so read them like one
Once the binding layer has converted the arguments, the method steps run. For any() they're one sentence: return the result of creating a dependent abort signal from signals, using AbortSignal and the current realm. The interface parameter exists so that TaskSignal.any() can reuse the same algorithm and get a TaskSignal back, which the original PR that added AbortSignal.any() describes.
Here is create a dependent abort signal as of today, paraphrased only to drop markup:
- Let
resultSignalbe a new object implementingsignalInterfaceusingrealm. - For each
signalofsignals: ifsignalis aborted, setresultSignal's abort reason tosignal's abort reason and returnresultSignal. - Set
resultSignal's dependent to true. - For each
signalofsignals:- If
signal's dependent is false, appendsignaltoresultSignal's source signals, and appendresultSignaltosignal's dependent signals. - Otherwise, for each
sourceSignalofsignal's source signals: assert thatsourceSignalis not aborted and not dependent, then link it the same way.
- If
- Return
resultSignal.
Read it like code and the claims fall out.
Step 2 is an early return in list order. The loop checks signals in the order given and returns on the first aborted one. So if two inputs are already aborted, you get the reason of the one listed first, not the one aborted first. And the returned signal is never marked dependent, so it has no sources and won't hold references to anything.
Step 4 flattens. A dependent signal is never linked to another dependent signal. If you pass any([a]) into another any(), the new signal links directly to a. That's the optimization the original PR described: putting "all children on non-composite signals" so intermediate signals can be garbage collected when they're only kept alive to propagate aborts.
The assertion in 4.2 is a claim the editors believe is always true. Spec assertions aren't runtime checks you can trigger from a page in the normal sense, but they do encode invariants, and an implementation that asserts them in debug builds will find out when they fail. That happened here, and the story is the best argument I know for reading the steps rather than the summary.
Fig. 1 lines the steps up against the subtests in abort-signal-any-tests.js. Most steps have a direct partner. The early return has "returns an aborted signal if passed an aborted signal" and "uses the first instance of a duplicate signal". The flattening has "works with intermediate signals" and, more precisely, "Abort events for AbortSignal.any() signals fire in the right order".
An assertion failed, and the fix changed a different algorithm
In June 2024, whatwg/dom issue #1293 reported that Gecko had found a case where the assertion in step 4.2.1 didn't hold. The example was small: create b = AbortSignal.any([a.signal]), add an abort listener to a.signal, and inside that listener call AbortSignal.any([b]). At that moment a.signal was aborted but b wasn't yet, because signal abort fired a's event before it propagated the abort to dependents. So step 4 walked into b's sources and found an aborted one.
The fix, PR #1295, merged on 2024-08-21, didn't touch any() at all. It split signal abort into two phases: first set the abort reason on the signal and all of its unaborted dependents, then run abort algorithms and fire events for the signal and those dependents. The PR notes that this keeps the existing event order while "ensuring the abort state is synced before any JS runs". The matching test came in WPT PR #47653, and today it's the subtest "Dependent signals for AbortSignal.any() are marked aborted before abort events fire": inside controller.signal's abort listener, it creates a new any() over a chain of dependents and asserts that every one of them already reads aborted === true.
The current signal abort steps show the split. It sets the reason, builds dependentSignalsToAbort by setting each unaborted dependent's reason, then runs the abort steps for the signal, then for each dependent. If you'd read only the any() steps, you'd have missed the fact that the observable ordering of a dependent signal's state lives in a different algorithm.
Flattening is observable through event order
Flattening sounds like an internal optimization, and the garbage collection rule that comes with it is normative but hard to test: the spec says a non-aborted dependent signal "must not be garbage collected while its source signals is non-empty and it has registered event listeners for its abort event or its abort algorithms is non-empty". You can't write a deterministic page-level test for "is not collected".
But flattening also changes event order, and that you can test. Here is the shape of the WPT subtest:
const controller = new AbortController();
const signals = [controller.signal];
signals.push(AbortSignal.any([controller.signal]));
signals.push(AbortSignal.any([controller.signal]));
signals.push(AbortSignal.any([signals[0]]));
// signals[1] is dependent, so this links straight to controller.signal.
signals.push(AbortSignal.any([signals[1]]));
let order = '';
signals.forEach((signal, i) => {
signal.addEventListener('abort', () => { order += i; });
});
controller.abort();
console.log(order);Every dependent is registered on controller.signal, in creation order, so the events fire 01234. If an engine linked signals[4] to signals[1] instead of flattening, signals[4] would fire from signals[1]'s abort steps and the string would come out differently. Node 24.18.0 prints 01234, and in the 2026-10-17 stable runs all four engines pass this subtest along with the other thirteen in abort-signal-any.any.js: 14 of 14 in both the window and worker variants.
Not every step is as tight as any()
any() is unusually precise. Streams' ReadableStreamPipeTo shows the other end of the range, and its vocabulary is different.
When the source is a byte stream, the reader is "either ! AcquireReadableStreamBYOBReader(source) or ! AcquireReadableStreamDefaultReader(source), at the user agent's discretion". Then the main loop is a labelled step that begins "In parallel but not really; see #905". Streams issue #905, titled "pipeTo says 'in parallel', but that isn't really right", has been open since March 2018. The step goes on to say that "the exact manner in which this happens is not observable to author code" because the reader and writer locks hide it, and then lists constraints that apply whatever algorithm the engine uses: public API must not be used, backpressure must be enforced, shutdown must stop activity, errors and closes must propagate in a fixed order.
That's a different kind of text from numbered steps, and it calls for different claims. "pipeTo uses a BYOB reader for byte streams" isn't testable from a page and isn't promised. "pipeTo never reads from the source while the destination's desired size is zero or less" is a "must", it's observable through a recording sink, and it's what WPT's flow-control.any.js exercises, down to a subtest named "Piping to a WritableStream that does not consume the writes fast enough exerts backpressure on the ReadableStream" (5 of 5 in all four engines today). Even inside the constraints, the modal verbs matter: "Reads or writes should not be delayed for reasons other than these backpressure signals" is a "should", and the spec says an implementation that waits for each write to complete before the next read "violates this recommendation". That's a recommendation broken, not a "must", so it's a weaker claim to bring to a review: a WPT subtest can't fail an engine for it the way it can for backpressure.
"Queue a global task" and "in parallel" tell you when a test can see a change
The phrases that cause the most confident wrong claims are the event-loop ones. They don't describe what happens; they describe when JavaScript can observe it. If you read them as "and then this happens", you'll predict state that a test can't see yet.
"In parallel" means off the event loop, and it can't touch JavaScript
The HTML Standard defines in parallel as steps that run "one after another, at the same time as other logic in the standard (e.g., at the same time as the event loop)", and explicitly doesn't define the mechanism: threads, processes, fibers, time-sharing. The guidance for spec authors adds the rule that matters for readers: in parallel steps "must not create or manipulate objects associated to a specific realm, global, or environment settings object", and can't touch Web IDL's this. To affect observable objects, the spec must "queue a global task", pick a task source, and name a global, so that "if that global object is inactive, the task does not run".
So when you read "in parallel" in a spec, the testable claim is never "the promise resolves after the work". It's "the promise resolves in a task on source X, queued after the work". Between those two there's a task queue, and the task waits its turn.
Plain "queue a task" leans on an implied document, and "queue a global task" names one
Queuing tasks defines the base primitive, queue a task, which optionally takes an event loop and a document. If they're omitted, it falls back to the implied event loop and implied document, and the spec is blunt about that: it means "relying on the ambiguous and poorly-specified implied event loop and implied document concepts", and authors should use the wrappers instead. The implied document's own definition ends with an assertion annotated "Really?", and HTML issue #4980, "Attempt to remove implied-document definition", has been open since October 2019.
Queue a global task fixes both values from the global: the event loop is the global's agent's event loop, and the document is the global's associated Document if it's a Window, otherwise null. The document matters because a task is runnable only "if its document is either null or fully active". A task queued for a document that's in the back/forward cache waits. A claim like "the abort event fires 100 ms later" is only true while the document stays fully active.
The DOM pattern for abortable APIs puts all of this in one place
The DOM Standard spells out how APIs should use AbortSignal. Accept the signal through a signal dictionary member, reject with the signal's abort reason, reject immediately if it's already aborted, and otherwise use abort algorithms to observe it. Its template method, doAmazingness(options), does exactly the sequence the HTML guidance describes: on the event loop, check the signal and add abort steps; in parallel, do the work; then "Queue a global task on the amazing task source given global to resolve p".
no JS objects, no realm
"amazing task source"
runnable only if its document is null or fully active
Fig. 2 draws that pattern as two lanes. The point to take from it is the wait at the end. The result exists in the in-parallel lane long before JavaScript can see it, and it becomes visible only when its task is picked.
The same template, written in userland for a cancellable delay, looks like this:
export function wait(ms, { signal } = {}) {
// Reject immediately if already aborted, with the signal's reason.
if (signal?.aborted) return Promise.reject(signal.reason);
return new Promise((resolve, reject) => {
const onAbort = () => {
clearTimeout(timerId);
reject(signal.reason);
};
const timerId = setTimeout(() => {
signal?.removeEventListener('abort', onAbort);
resolve();
}, ms);
signal?.addEventListener('abort', onAbort, { once: true });
});
}A timeout signal can't abort in the middle of your code
Now read the timeout() method steps with that vocabulary. They create the signal, then "Run steps after a timeout given global, "AbortSignal-timeout", milliseconds", and the completion step is "Queue a global task on the timer task source given global to signal abort". The abort is a task. Until that task runs, signal.aborted is false, however much time has passed.
That has a sharp consequence, and it's the subject of whatwg/dom issue #1461, "AbortSignal.timeout() only aborts from a task", opened in March 2026 and still open. The reporter wanted a synchronous loop that checks signal.aborted to stop after 500 ms; it never stops. A reply in the thread from Anne van Kesteren, who writes the DOM Standard, suggests queuing tasks so the work doesn't block the event loop. The less obvious version of the trap is an async loop that only ever awaits already-settled promises. Each await resumes in a microtask, the microtask queue never empties, and the timer task never gets picked. I ran this in Node 24.18.0:
const signal = AbortSignal.timeout(50);
const start = performance.now();
// Each await resumes in a microtask, so no task runs in this loop.
while (performance.now() - start < 500) {
await Promise.resolve();
}
console.log('after 500 ms:', signal.aborted);
// Yield to a task, and the timer's abort task gets its turn.
await new Promise((resolve) => setTimeout(resolve, 0));
console.log('after a task:', signal.aborted, signal.reason.name);It printed after 500 ms: false, then after a task: true TimeoutError. That's Node, but the prediction comes straight from the spec text, and it's the claim you'd want to test in browsers before relying on AbortSignal.timeout() to bound a CPU-heavy loop: the signal can only abort at a task boundary.
Timers promise an order, not a time
Run steps after a timeout shows how to read a timing algorithm. For a Window, it waits until the document "has been fully active for a further milliseconds milliseconds (not necessarily consecutively)". It then waits for earlier invocations with the same global and ordering identifier, and with a shorter or equal delay, to complete. Then: "Optionally, wait a further implementation-defined length of time", which the note says lets user agents pad timers to save power.
So there are three claims, and only two are testable as exact statements. Two AbortSignal.timeout(5) calls made in sequence abort in sequence: that's the ordering-identifier step, and it's exactly what the subtest "AbortSignal timeouts fire in order" asserts. A timeout signal doesn't abort before its delay has elapsed while the document is fully active: testable as a lower bound. When it aborts after that is implementation-defined: not testable as an exact value, only measurable.
The same reasoning applies to the event loop itself. In the processing model, the event loop picks a task queue with a runnable task "chosen in an implementation-defined manner". Two tasks on the same source run in order. Tasks on different sources have no specified relative order, so a test that asserts one is a test of one engine's scheduler.
Spin the event loop is a macro
One more phrase, because it reads like a function call and isn't. Spin the event loop saves the JavaScript execution context stack, empties it, performs a microtask checkpoint, and then, in parallel, waits for its condition and queues a task to resume "any steps that appear after this spin the event loop instance in the original algorithm". The spec says it "is more like a macro". The testable consequence: code after a spin runs in a new task, after microtasks have drained, so state set by promise reactions queued before the spin is visible after it.
"Implementation-defined" is an instruction to measure
The Infra Standard defines the term in one sentence: when something is implementation-defined, "the particulars of what is said to be implementation-defined are up to the implementation", and in the absence of such language, implementations have to follow the rules. That's the whole definition. It doesn't say "unspecified, so anything goes"; it says the spec has stopped making claims and handed the question to each engine.
That makes it an instruction for the reader. Every "implementation-defined" in an algorithm marks a spot where "the spec says" can't finish the sentence, and where any claim you make has to be phrased as "engine E, version V, under conditions C, measured by method M".
Some examples from the specs this article touches:
- Speculation rules eagerness. The eagerness values describe intent ("on even a slight suggestion" for
eager, "very likely to navigate to this URL at any moment" forconservative) with "for instance" examples, and the processing text says user agents act on interest "in one of the implementation-defined ways that the user agent uses to implement the speculation rule eagerness heuristics". The spec does define an ordering (one eagerness is "less eager" than another if it follows it in the list), but that's a comparison between values, not a timing guarantee. How long a hover has to last beforemoderatekicks in is a per-engine fact you'd have to measure. - Storage quota. The Storage Standard calls quota "an implementation-defined conservative estimate of the total amount of bytes it can hold", and then adds a hard constraint: it "must not be a function of the available storage space on the device". That's a privacy rule. You can claim the "must"; you have to measure the number.
- Timer padding and task-queue selection, above.
- The BYOB choice in pipeTo, which is "at the user agent's discretion" and, by the spec's own argument, not observable to author code.
The useful habit is to split each claim at the boundary. "pipeTo enforces backpressure" is spec. "Engine E, version V, reads chunks of size N from a byte stream under conditions C" is the shape of a measurement, and it needs a method and a date before anyone should repeat it. If you put both in one sentence, a reviewer can't tell which part to verify against the spec and which part against a browser.
Tests live next to the spec, and their file names mislead a little
Web Platform Tests is organized by spec, and the directory for AbortSignal is dom/abort/. As of today it holds AbortSignal.any.js, abort-signal-any.any.js, abort-signal-any-crash.html, abort-signal-timeout.html, event.any.js, reason-constructor.html, timeout.any.js, a crashtests/ folder, a resources/ folder with abort-signal-any-tests.js, and a WEB_FEATURES.yml that maps abort-signal-any.any.js to the web-features ids abortsignal-any and aborting, and everything else in the folder to aborting. That mapping is how webstatus.dev ties the abortsignal-any feature to tests; the feature reads widely available there, with a low date of 2024-03-19 (Firefox 124, the last of the core browsers after Chrome and Edge 116 and Safari 17.4) and a high date of 2026-09-19.
.any.js is a suffix, not a word
The testharness.js docs on multi-global tests explain that a file ending in .any.js runs, by default, "in a window scope and a dedicated worker scope", served as x.any.html and x.any.worker.html. A // META: global= comment changes the set; worker is shorthand for dedicated, shared and service workers. That's why Streams' tests (// META: global=window,worker) show up four times on wpt.fyi and the dom/abort ones twice.
It also sets a naming trap that's easy to walk into. AbortSignal.any.js is not a test of AbortSignal.any(). It's a test of AbortSignal.abort(), named AbortSignal plus the .any.js suffix, and it carries an explicit // META: global=window,dedicatedworker. The tests for any() are in abort-signal-any.any.js, a short file that loads the shared resource and calls abortSignalAnySignalOnlyTests(AbortSignal) and abortSignalAnyTests(AbortSignal, AbortController). The shared resource is parameterized by interface, the same way the spec algorithm is, so that TaskSignal tests can reuse it.
Read the assertion, not the subtest name
A testharness.js file is a list of test(), async_test() and promise_test() calls, each with a name that must be unique in the file. Names are summaries, and summaries can be broader than the assertions. "returns an aborted signal if passed an aborted signal" does this:
controllers[1].abort("reason 1");
controllers[2].abort("reason 2");
const signal = signalInterface.any(controllers.map(c => c.signal));
assert_true(signal.aborted);
assert_equals(signal.reason, "reason 1",
"The signal should be aborted with the first reason");The second and third signals are aborted in the same order they're listed. So "the first reason" could mean first in list order or first in time, and this assertion can't tell the difference. The duplicate-signal subtest has the same property: the signal aborted first is also listed first. I read all fourteen subtests and didn't find one that aborts a later-listed signal before an earlier-listed one. Step 2 of the algorithm is unambiguous about list order, the engines may well all implement it that way, and Node 24.18.0 does; but the specific clause in my claim isn't pinned by a test in this directory. That's the gap Fig. 1 ends on.
The assertion helpers matter too. promise_rejects_js(t, TypeError, p) checks the constructor of the rejection; promise_rejects_exactly(t, value, p) checks identity with a specific value. When you map a spec step that says "reject p with signal's abort reason" to a test, you want the second kind, because the claim is about which value, not which type.
Pin the runs before you read the results
wpt.fyi is client-rendered, so I read it through its API. The API documentation has the warning that matters in one line under /api/search: run_ids "Defaults to the default runs returned by /api/runs. NOTE: This is not the same set of runs as is shown on wpt.fyi by default."
The default is whatever ran most recently, and it moves during the day. When I re-checked /api/runs with no parameters on the morning of October 18, it returned Chrome 158 dev, Edge 157 dev, Firefox 160 nightly and Safari Technology Preview 254, three of them labelled pr_head or pr_base: runs made for pull requests, not for the main branch. The /api/search?q=dom/abort/ query with no run IDs follows the same moving default. Earlier that day it had used Chrome 158 canary, Edge 157 dev, Firefox 160 nightly and Safari 254 preview, and you can still reproduce that table by pinning those four run IDs: the Safari column reads 0 of 0 for every dom/abort test. On my re-check, only the Edge column had any results at all. A reader who skims either table sees browsers with nothing passing.
The fix is to pin. /api/runs?label=master&label=stable&max-count=1 returned four runs from 2026-10-17, all at WPT revision df642c4142: Chrome 155.0.8059.84 on Linux, Edge 155.0.4283.62 on Windows, Firefox 158.0 on Linux and Safari 27.0 on macOS. Passing those IDs to /api/search gives the stable results: 14 of 14 for abort-signal-any.any.html and .worker.html in all four, 16 of 16 for event.any, 3 of 3 for timeout.any.
Fig. 3 puts the two tables side by side. Neither one is wrong; they answer different questions. The default answers "what did the latest runs of anything produce", and the pinned one answers "do the shipping browsers pass", which is the one a design review usually means. The four stable runs are also all desktop builds (Linux, Windows and macOS); the Baseline article in this series covers how mobile runs have to be requested separately.
A real failure looks like a single subtest, and it points back at the spec
Pinning also surfaces real disagreements. In the same stable runs, streams/piping/abort.any.js passes 33 of 33 in Chrome and Edge and 32 of 33 in Firefox and Safari, in all four scopes. The stored per-subtest results for Firefox 158 and Safari 27.0 name the same failure: "a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()". Both engines rejected with error1 (the source's cancel rejection) where the test's promise_rejects_exactly expects error2 (the sink's abort rejection). That's the identity-checking helper from the previous section doing its job: a promise_rejects_js(t, Error, ...) check would have passed both. You can see it on the wpt.fyi results page for that file.
To read that failure against the spec, follow the steps. In ReadableStreamPipeTo, the abort algorithm builds an ordered set of actions: the destination abort first if preventAbort is false, then the source cancel if preventCancel is false. Then it shuts down "with an action consisting of getting a promise to wait for all of the actions". Web IDL's wait for all behaves like Promise.all(): the first rejection handler to run sets rejected and wins, and later rejections are ignored. So which error you get depends on which of the two promises rejects first, which depends on the exact steps of WritableStreamAbort and ReadableStreamCancel. The test also asserts the call order (abort before cancel). I haven't traced why two engines settle the other way, so I won't claim to know; but this is what a precise claim looks like: one subtest, one pair of values, one spec step to investigate.
Types are a lossy third copy of the IDL
Most of us meet these APIs through TypeScript, and its lib.dom.d.ts is generated from spec IDL by TypeScript-DOM-lib-generator. The README states the inclusion rule: "A feature needs to be supported by two or more major browser engines to be included here", counting Gecko, Blink and WebKit, with the note that "Chromium-based browsers use the same browser engine and thus support from them counts as a single support". The check runs against MDN's compat data; if MDN is wrong, the README says to fix it there, and the type "will be automatically added in a few weeks".
That's a support rule, not a correctness rule, and the generated types drop several things the IDL said. In the generator's current baselines/dom.generated.d.ts (last changed on 2026-10-14 when I read it):
StreamPipeOptionsbecomespreventAbort?: boolean; preventCancel?: boolean; preventClose?: boolean; signal?: AbortSignal;. The= falsedefaults are gone. The type can't tell you that omittingpreventClosemeansfalse, or thatsignalalone has no default.AbortSignal.anyis declared asany(signals: AbortSignal[]): AbortSignal. The IDL takessequence<AbortSignal>, which accepts any iterable, soAbortSignal.any(new Set(signals))works at runtime and fails type-checking.AbortSignal.timeoutistimeout(milliseconds: number): AbortSignal.[EnforceRange] unsigned long longcollapses tonumber, so the type has no opinion about-1orInfinity.
None of these are bugs in the generator; TypeScript's type system has no way to express a dictionary default or a ranged integer. The point is that the types are evidence of what exists in at least two engines (by MDN's account), not of how it behaves. A type error is never a spec citation, and the absence of one isn't either. The track's piece on how TypeScript models the DOM (PLT-50) goes further into the generator and its blind spots.
Worked end to end, the claim needs one more test
Back to the design review. Here's the claim, annotated against its sources, as I'd write it in a pull request comment. Status is for the 2026-10-17 stable runs: Chrome 155, Edge 155, Firefox 158, Safari 27.0.
| Clause | Spec source | WPT subtest | Status |
|---|---|---|---|
| Returns a new signal | [NewObject] in the IDL; step 1 |
"follows a single signal" (assert_not_equals) |
passes in all four |
| Already aborted if any input is | Step 2 | "returns an aborted signal if passed an aborted signal" | passes in all four |
| Reason is from the first aborted input in list order | Step 2 (loop order) | none found that separates list order from abort order | not pinned |
| Same reason value, not a copy | Step 2 (sets the reason to that signal's reason) | "should use the same DOMException instance from the already aborted source signal" | passes in all four |
| Later aborts propagate through nesting | Step 4 (flattening) | "works with intermediate signals", "fire in the right order" | passes in all four |
| Dependents are aborted before any listener runs | signal abort (two phases, PR #1295) | "are marked aborted before abort events fire" | passes in all four |
| Window and dedicated worker | [Exposed=*]; .any.js defaults |
.any.html and .any.worker.html variants |
14/14 in both |
The one row without a test is the one my original claim leaned on. If I were going to rely on it, here's the test I'd propose upstream. It follows the existing file's style and would slot into abortSignalAnyTests, but I haven't submitted it, and I've only run its logic in Node 24.18.0, not in WPT's harness:
test(() => {
const listedFirst = new AbortController();
const listedSecond = new AbortController();
listedSecond.abort('aborted earlier, listed second');
listedFirst.abort('aborted later, listed first');
const signal = AbortSignal.any([listedFirst.signal, listedSecond.signal]);
assert_true(signal.aborted);
assert_equals(signal.reason, 'aborted later, listed first',
'the reason follows list order, not abort order');
}, 'AbortSignal.any() takes the reason of the first aborted signal in list order');That's the method. Compressed into the steps I now run whenever "the spec says" comes up in a review:
- Write the claim as an assertion. Inputs, the observable value, and the scope. If you can't write it as
assert_equals(actual, expected), it isn't a claim yet. - Read the IDL first. Return type (promise or not), extended attributes, dictionary defaults and member order,
[Exposed]. A lot of "it throws" arguments end here. - Read the steps like code. Loops, early returns, which algorithm sets the state you care about (it may be a different one, as with signal abort), and every assertion.
- Translate the event-loop vocabulary into "when". In parallel means not observable yet. Queue a global task means observable when that task runs, on that source, if the document is fully active. Microtasks don't let tasks run.
- Split at "implementation-defined". Claim the constraints the spec states; measure the rest, with engine, version and method.
- Find the subtest for each clause, and read its assertions. Watch for
.any.jsnaming, and for subtests whose setup can't distinguish your clause from a neighbor. - Pin the runs. Use labelled stable run IDs from
/api/runs, not the default search, and record the revision and versions. - Treat types as a support signal only. Never cite
lib.dom.d.tsfor behavior.
If you need the claim to hold and step 6 comes up empty, you have two honest options: write the test (and ideally upstream it), or move the clause out of the review comment and into the list of things you don't know.
What we don't know
- Whether every engine follows list order in
any()'s early return. The spec is clear and Node 24.18.0 follows it, but I found no WPT subtest indom/abortthat separates list order from abort order. A test like the one above, run on wpt.fyi, would settle it. - Whether browsers throw
TypeErrorforAbortSignal.timeout(-1)andAbortSignal.timeout(Infinity). Web IDL's[EnforceRange]says they must.timeout.any.jsdoesn't test it, and I didn't check whether WPT's generated IDL tests (idlharness) cover argument ranges for this method. Node 24.18.0 throwsRangeError. A browser run of the two calls, or a subtest, would settle it. - Why Firefox 158 and Safari 27.0 fail "a rejection from underlyingSink.abort() should be preferred to one from underlyingSource.cancel()". I traced the spec to Web IDL's wait for all, where the first rejection wins, but not through WritableStreamAbort and ReadableStreamCancel, and I didn't find a bug report linked from the test. Whether the engines or the test are out of step with the spec text is open.
- Whether any engine picks a BYOB reader in
pipeTofor byte streams. It's "at the user agent's discretion", and the spec argues it isn't observable to author code. Engine source code would answer it; a page-level test probably can't. - Whether the wpt.fyi search API's default can be relied on for anything. Its documentation says it differs from the website's default, and on October 18 it moved between two run sets in a few hours, each with empty columns for
dom/abort. Until that changes, I'd treat any result without explicit run IDs as unpinned. - How "in parallel but not really" will be resolved. Streams issue #905 has been open since 2018, so the pipe loop's relationship to the event loop is still described by constraints, not steps.
- When the implied event loop and implied document go away. HTML issue #4980 is open; until it closes, older specs that "queue a task" without a global inherit the ambiguity the HTML Standard itself warns about.
- Whether
AbortSignal.timeout()will ever abort outside a task. DOM issue #1461 is open, and the editor's reply in it points towards queuing tasks rather than changingtimeout(). If it does change, the microtask-starvation claim above changes with it.
References
- DOM Standard - AbortSignal.any(). WHATWG>. Accessed .
- DOM Standard - Acknowledgments (authorship). WHATWG>. Accessed .
- DOM Standard - Interface AbortSignal (IDL). WHATWG>. Accessed .
- DOM Standard - create a dependent abort signal. WHATWG>. Accessed .
- DOM Standard - signal abort. WHATWG>. Accessed .
- DOM Standard - AbortSignal.timeout(). WHATWG>. Accessed .
- DOM Standard - Using AbortController and AbortSignal objects in APIs. WHATWG>. Accessed .
- AbortSignal.any() assertion failure (whatwg/dom issue #1293). WHATWG>. Accessed .
- Mark dependent abort signals as aborted before firing events (whatwg/dom PR #1295). WHATWG>. Accessed .
- Add AbortSignal.any() (whatwg/dom PR #1152). WHATWG>. Accessed .
- AbortSignal.timeout() only aborts from a task (whatwg/dom issue #1461). WHATWG>. Accessed .
- AbortSignal: Propagate aborted state to dependent signals before firing events (WPT PR #47653). Web Platform Tests>. Accessed .
- HTML Standard - Queuing tasks. WHATWG>. Accessed .
- HTML Standard - Dealing with the event loop from other specifications. WHATWG>. Accessed .
- HTML Standard - Event loop processing model. WHATWG>. Accessed .
- HTML Standard - Task (runnable). WHATWG>. Accessed .
- HTML Standard - Spin the event loop. WHATWG>. Accessed .
- HTML Standard - in parallel. WHATWG>. Accessed .
- HTML Standard - Run steps after a timeout. WHATWG>. Accessed .
- HTML Standard - Speculation rule eagerness. WHATWG>. Accessed .
- Attempt to remove implied-document definition (whatwg/html issue #4980). WHATWG>. Accessed .
- Streams Standard - StreamPipeOptions. WHATWG>. Accessed .
- Streams Standard - pipeTo() method steps. WHATWG>. Accessed .
- Streams Standard - ReadableStreamPipeTo. WHATWG>. Accessed .
- pipeTo says "in parallel", but that isn't really right (whatwg/streams issue #905). WHATWG>. Accessed .
- Web IDL - Dictionaries. WHATWG>. Accessed .
- Web IDL - Dictionary types (JavaScript binding). WHATWG>. Accessed .
- Web IDL - Sequences (JavaScript binding). WHATWG>. Accessed .
- Web IDL - Names (identifier escaping). WHATWG>. Accessed .
- Web IDL - Operations (JavaScript binding). WHATWG>. Accessed .
- Web IDL - create an operation function. WHATWG>. Accessed .
- Web IDL - ConvertToInt and [EnforceRange]. WHATWG>. Accessed .
- Web IDL - wait for all. WHATWG>. Accessed .
- Infra Standard - implementation-defined. WHATWG>. Accessed .
- Storage Standard - storage quota. WHATWG>. Accessed .
- WHATWG Working Mode - Anchor permanence. WHATWG>. Accessed .
- WPT dom/abort/resources/abort-signal-any-tests.js. Web Platform Tests>. Accessed .
- WPT dom/abort/abort-signal-any.any.js. Web Platform Tests>. Accessed .
- WPT dom/abort/AbortSignal.any.js. Web Platform Tests>. Accessed .
- WPT dom/abort/timeout.any.js. Web Platform Tests>. Accessed .
- WPT dom/abort/WEB_FEATURES.yml. Web Platform Tests>. Accessed .
- WPT streams/piping/throwing-options.any.js. Web Platform Tests>. Accessed .
- WPT streams/piping/abort.any.js. Web Platform Tests>. Accessed .
- testharness.js API. Web Platform Tests>. Accessed .
- testharness.js tests - Tests for other or multiple globals (.any.js). Web Platform Tests>. Accessed .
- wpt.fyi API documentation. Web Platform Tests>. Accessed .
- wpt.fyi API - latest stable runs. Web Platform Tests>. Accessed .
- wpt.fyi API - default runs (no labels). Web Platform Tests>. Accessed .
- wpt.fyi API - dom/abort results for the 2026-10-17 stable runs. Web Platform Tests>. Accessed .
- wpt.fyi API - dom/abort results with default runs. Web Platform Tests>. Accessed .
- wpt.fyi API - dom/abort results for the early 2026-10-18 default runs, pinned. Web Platform Tests>. Accessed .
- WPT streams/piping/flow-control.any.js. Web Platform Tests>. Accessed .
- Web IDL - [NewObject]. WHATWG>. Accessed .
- Web IDL - [Exposed]. WHATWG>. Accessed .
- wpt.fyi API - streams/piping results for the 2026-10-17 stable runs. Web Platform Tests>. Accessed .
- wpt.fyi - streams/piping/abort.any.html (stable). Web Platform Tests>. Accessed .
- wpt.fyi stored result - Firefox 158 streams/piping/abort.any.html. Web Platform Tests>. Accessed .
- wpt.fyi stored result - Safari 27.0 streams/piping/abort.any.html. Web Platform Tests>. Accessed .
- TypeScript-DOM-lib-generator README. Microsoft>. Accessed .
- TypeScript-DOM-lib-generator baselines/dom.generated.d.ts. Microsoft>. Accessed .
- webstatus.dev - AbortSignal.any(). Web Platform Status>. Accessed .