Re: [whatwg/dom] Add AbortSignal.any() (PR #1152)

@shaseley commented on this pull request.



>  </ol>
 
-<p>A <var>followingSignal</var> (an {{AbortSignal}}) is made to
-<dfn export for=AbortSignal>follow</dfn> a <var>parentSignal</var> (an {{AbortSignal}}) by running
-these steps:
+<p>To <dfn export>create a composite abort signal</dfn> from a list of {{AbortSignal}} objects
+<var>signals</var>, using <var>signalInterface</var>, which must be either {{AbortSignal}} or an
+interface that inherits from it, and an optional <var>realm</var>, run these steps:

This is here is to allow subclasses to invoke this as an internal constructor, since they may need to specialize the behavior (if this is premature, I can remove and monkeypatch for [`TaskSignal`](https://github.com/shaseley/abort-signal-any#tasksignal-apis)). I'm borrowing the language from [event creation](https://dom.spec.whatwg.org/#concept-event-create), trying to keep this locally consistent.

Can you recommend alternative wording? To me, "which must be an {{AbortSignal}}" implies an AbortSignal object and "which must be {{AbortSignal}}" implies subclasses are excluded since it names it specifically. I didn't find anything in infra about inheritance wording, which is one reason I looked for something locally in the DOM spec.

>  
 <ol>
- <li><p>If <var>followingSignal</var> is [=AbortSignal/aborted=], then return.
+ <li><p>Let <var>resultSignal</var> be a <a for=/>new</a> object implementing
+ <var>signalInterface</var> using <var>realm</var> if given, otherwise using the default behavior
+ defined in Web IDL.

Thanks. I copied the language from [event creation](https://dom.spec.whatwg.org/#inner-event-creation-steps), which does something similar, but I didn't copy the note w/ related Web IDL issue. I added the same note; does this address the concern? 

FYI the reason this takes an optional realm is because [`new Request()`](https://fetch.spec.whatwg.org/#dom-request) in the fetch spec (step 29) creates a new signal in a specific realm, but in this spec we just create new signals without specifying a realm.

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

Message ID: <whatwg/dom/pull/1152/review/1322799419@github.com>

Received on Friday, 3 March 2023 00:24:27 UTC