https://github.com/whatwg/dom/pull/960 introduces a new utility `AbortSignal.abort()` that creates and returns an already aborted AbortSignal. Example implementation in Node.js: https://github.com/nodejs/node/pull/37693. WPT Test: https://github.com/web-platform-tests/wpt/pull/28003
<rdar://problem/75575483>
Created attachment 423772 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 423772 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423772&action=review > Source/WebCore/dom/AbortSignal.h:45 > + static Ref<AbortSignal> createAborted(ScriptExecutionContext&); Why not name this abort to match the DOM public API?
Comment on attachment 423772 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423772&action=review >> Source/WebCore/dom/AbortSignal.h:45 >> + static Ref<AbortSignal> createAborted(ScriptExecutionContext&); > > Why not name this abort to match the DOM public API? Because the abort() name is very confusing for such operation. Also, AbortSignal already has an abort() member function to actually abort the signal. I wish the spec had called this aborted() instead of abort()..
Comment on attachment 423772 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423772&action=review >>> Source/WebCore/dom/AbortSignal.h:45 >>> + static Ref<AbortSignal> createAborted(ScriptExecutionContext&); >> >> Why not name this abort to match the DOM public API? > > Because the abort() name is very confusing for such operation. Also, AbortSignal already has an abort() member function to actually abort the signal. I wish the spec had called this aborted() instead of abort().. I think we should match the spec here and rename the other function to signalAbort, which is what the spec calls it. Even if we don’t love the names, it’s much easier if we match things when we can.
commit-queue failed to commit attachment 423772 [details] to WebKit repository. To retry, please set cq+ flag again.
(In reply to Sam Weinig from comment #6) > Comment on attachment 423772 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=423772&action=review > > >>> Source/WebCore/dom/AbortSignal.h:45 > >>> + static Ref<AbortSignal> createAborted(ScriptExecutionContext&); > >> > >> Why not name this abort to match the DOM public API? > > > > Because the abort() name is very confusing for such operation. Also, AbortSignal already has an abort() member function to actually abort the signal. I wish the spec had called this aborted() instead of abort().. > > I think we should match the spec here and rename the other function to > signalAbort, which is what the spec calls it. Even if we don’t love the > names, it’s much easier if we match things when we can. Ok, will update the name.
Created attachment 423885 [details] Patch
Committed r274773: <https://commits.webkit.org/r274773> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423885 [details].