* 文脈

[FIG(short list)[ [20] 
- [[abortable fetch]]
- [CODE[pipeTo]]
]FIG]

* 実装

[26] [TIME[2017年][year:2017]]末時点で [[Firefox]] と [[Edge]] が実装済みです。

* 歴史

** 取消可能約束

[9] [CODE[Promise]] が [[TC39]] により [[ECMAScript]] に取り込まれた後、
中止機能を追加することが検討されました ([DFN[cancellable promise]])。

[10] [[約束]]は[[履行]]か[[拒絶]]の2状態のいずれかに至りますが、
第3の取消の状態を導入して [CODE[catch]] に相当する新構文を追加するといった案もありました。

[11] しかし [[Google]] の [[JavaScript]] 関係者の強行な反対により、提案は取り下げられました。
(提案の中心人物の [[Domenic Denicola]] も [[Google]] 社員ですが、
社内の問題で継続できなくなったということだけ説明していて [SRC[>>8]]、
詳細な事情は不明です。技術的な問題ではなく、[[政治的]]な圧力の気配があります。)

[16] [CITE@en[Issues · promises-aplus/cancellation-spec]] ([TIME[2017-07-16 20:52:45 +09:00]]) <https://github.com/promises-aplus/cancellation-spec/issues>

[52] [CITE[Terminating a fetch — Anne’s Blog]]
([TIME[2015-02-21 13:09:09 +09:00]] 版)
<https://annevankesteren.nl/2015/02/cancelable-promises>

[7] [CITE@en[tc39/proposal-cancelable-promises: Former home of the now-withdrawn cancelable promises proposal for JavaScript]] ([TIME[2017-07-16 20:35:08 +09:00]]) <https://github.com/tc39/proposal-cancelable-promises>

[8] [CITE@en[Why was this proposal withdrawn? · Issue #70 · tc39/proposal-cancelable-promises]] ([TIME[2017-07-16 20:36:20 +09:00]]) <https://github.com/tc39/proposal-cancelable-promises/issues/70>

** DOM [CODE[AbortController]]

[15] [[cancellable promise]] の開発が中止された後、
[[cancellable promise]] を使う予定だった [CODE[fetch]] 
の中断機能の新設計が [[WHATWG]] で検討されました。

[13] [[fetch]] に限らず [[Web]] の [[API]] の共通の中断機能を導入することとなり、
[TIME[2017年][year:2017]]、
[CITE[DOM Standard]] に [CODE[AbortController]] が追加されました。

[6] [CITE@en[Aborting a fetch: The Next Generation · Issue #447 · whatwg/fetch]]
([TIME[2017-07-16 20:34:49 +09:00]])
<https://github.com/whatwg/fetch/issues/447>

[12] [CITE@en[Fetch termination API "meeting" · Issue #455 · whatwg/fetch]] ([TIME[2017-07-16 20:47:13 +09:00]]) <https://github.com/whatwg/fetch/issues/455>

[4] [CITE@en[Define a 'CancelationController' and 'CancelationSignal' interface. by mikewest · Pull Request #434 · whatwg/dom]] ([TIME[2017-07-16 20:30:26 +09:00]]) <https://github.com/whatwg/dom/pull/434>

[2] [CITE@en[Abort controller by jakearchibald · Pull Request #437 · whatwg/dom]]
([TIME[2017-07-16 20:25:33 +09:00]])
<https://github.com/whatwg/dom/pull/437>

[3] [CITE@en[Abort controller design · Issue #438 · whatwg/dom]]
([TIME[2017-07-16 20:29:15 +09:00]])
<https://github.com/whatwg/dom/issues/438>

[14] [CITE@en[WIP: Cancelation by jakearchibald · Pull Request #523 · whatwg/fetch]] ([TIME[2017-07-16 20:51:32 +09:00]]) <https://github.com/whatwg/fetch/pull/523>

[5] [CITE@en[Should the WebAuth API have a cancel() method? · Issue #380 · w3c/webauthn]]
([TIME[2017-07-16 20:34:28 +09:00]])
<https://github.com/w3c/webauthn/issues/380>

[1] [CITE@en[Define AbortController and AbortSignal classes]]
([[jakearchibald]]著, [TIME[2017-07-14 22:59:09 +09:00]])
<https://github.com/whatwg/dom/commit/1c58d2cf4279ade63f1c5c7d200156cfdda89b7c>


[17] [CITE[AbortController polyfill for cancelling fetch()]]
([TIME[2017-07-25 07:00:02 +09:00]])
<https://mo.github.io/2017/07/24/abort-fetch-abortcontroller-polyfill.html>

[27] それでもやはり [[JavaScript]] で中断機能を標準化するべきと考える人々が
[[WHATWG]] の作業の完了を見て慌てて
[[TC39]] で作業を始めたようですが、完成には程遠い状態です。
([[WHATWG]] での開発も素早くといいつつ数ヶ月かかっているので、
同じことを別個にやろうとすれば当然時間はかかるでしょう。)

[18] [CITE@en[tc39/proposal-cancellation: Proposal for a Cancellation API for ECMAScript]]
([TIME[2017-07-25 11:32:10 +09:00]])
<https://github.com/tc39/proposal-cancellation>

[19] [CITE@en[Abortable fetch]]
([[jakearchibald]]著, [TIME[2017-09-20 21:59:57 +09:00]])
<https://github.com/whatwg/fetch/commit/0bcd5dfc71ef44319873887f4b83119bd6d0b71d>

[21] [CITE@en[750599 - Implement AbortController, AbortSignal, abortable fetch - chromium - Monorail]]
([TIME[2017-12-10 00:06:18 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=750599>

[22] [CITE@en[174980 – '''['''Fetch API''']''' Implement abortable fetch]]
([TIME[2017-12-10 00:07:13 +09:00]])
<https://bugs.webkit.org/show_bug.cgi?id=174980>

[23] [CITE@en[1378342 - Aborting fetch (and possibly streams), part 2]]
([TIME[2017-12-10 00:07:50 +09:00]])
<https://bugzilla.mozilla.org/show_bug.cgi?id=1378342>

[24] [CITE@en-US[Fetch Javascript API should be abortable - Microsoft Edge Development]]
([TIME[2017-12-10 00:09:02 +09:00]])
<https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13009916/>

[25] [CITE@en-US[AbortController - Web APIs | MDN]]
([TIME[2017-11-27 12:25:37 +09:00]])
<https://developer.mozilla.org/en-US/docs/Web/API/AbortController>

[28] [[Firefox]] でも [[Edge]] でも、
標準状態で有効になっています。 [TIME[2017-12-09T15:18:15.00Z]]

[29] [CITE@en[Add a specification hook for AbortSignals to follow each other]]
([[jakearchibald]]著, [TIME[2018-02-13 00:49:51 +09:00]])
<https://github.com/whatwg/dom/commit/7728021dd26dff7586816955757cde78280fcaf4>

[30] [CITE@en[Following an abort signal by jakearchibald · Pull Request #569 · whatwg/dom]]
([TIME[2018-02-13 14:27:03 +09:00]])
<https://github.com/whatwg/dom/pull/569>

[31] [CITE@en[Allow aborting an ongoing pipe operation using AbortSignals]]
([[domenic]]著, [TIME[2018-11-08 07:14:47 +09:00]])
<https://github.com/whatwg/streams/commit/46c3b89dd3aff28b2fc381dd1d397c12b4fb8a16>

[32] [CITE@en[pipeTo should return a cancelable promise · Issue #446 · whatwg/streams]]
([TIME[2019-03-08 16:54:35 +09:00]])
<https://github.com/whatwg/streams/issues/446>

[33] [CITE@en[Allow aborting an ongoing pipe operation using AbortSignals by domenic · Pull Request #744 · whatwg/streams]]
([TIME[2019-03-08 16:56:04 +09:00]])
<https://github.com/whatwg/streams/pull/744>


[66] [CITE@en[Add onabort definition and add onslotchange by domenic · Pull Request #785 · whatwg/dom]]
([TIME[2020-05-14 13:29:25 +09:00]])
<https://github.com/whatwg/dom/pull/785>

[67] [CITE@en[Define the onabort event handler IDL attribute]]
([[domenic]]著, [TIME[2019-09-20 13:08:00 +09:00]])
<https://github.com/whatwg/dom/commit/e017c7ad4c24d9870f4029564d820243d90cf4c6>




[34] [CITE@en[Add onabort definition and add onslotchange by domenic · Pull Request #785 · whatwg/dom]]
([TIME[2020-05-14 13:32:47 +09:00]])
<https://github.com/whatwg/dom/pull/785>

[35] [CITE@en[Align with IDL constructor changes]]
([[autokagami]]著, [TIME[2019-09-24 22:42:56 +09:00]])
<https://github.com/whatwg/dom/commit/57512fac17cf2f1c4c85be4aec178c8086ee5ee4>

[36] [CITE@en[Update to constructor operations · Issue #780 · whatwg/dom]]
([TIME[2020-05-14 14:04:46 +09:00]])
<https://github.com/whatwg/dom/issues/780>

[37] [CITE@en['''['''dom''']''' Align with Web IDL specification by autokagami · Pull Request #786 · whatwg/dom]]
([TIME[2020-05-14 14:06:04 +09:00]])
<https://github.com/whatwg/dom/pull/786>