Skip to content

Commit 981a9db

Browse files
[fetch] Add a textStream() method to the Body mixin whatwg/fetch@30140d0
1 parent c3240e1 commit 981a9db

1 file changed

Lines changed: 107 additions & 9 deletions

File tree

Fetch-ja.html

Lines changed: 107 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@
207207
●●options
208208

209209
spec_title:Fetch
210-
spec_date:2026-05-08
211-
trans_update:2026-05-14
210+
spec_date:2026-06-05
211+
trans_update:2026-06-11
212212
source_checked:250918
213213
spec_status:LS
214214
original_url:https://fetch.spec.whatwg.org/
@@ -555,6 +555,7 @@
555555
I.ServiceWorkerGlobalScope:~SW1#serviceworkerglobalscope
556556
I.ReferrerPolicy:~REFERRER-POLICY#enumdef-referrerpolicy
557557
I.EventSource:~HTMLsse#eventsource
558+
I.TextDecoderStream:~ENCODING#textdecoderstream
558559

559560

560561
I.WindowOrWorkerGlobalScope:~HTMLGAPI#windoworworkerglobalscope
@@ -1158,6 +1159,7 @@
11581159
RS.~byte読取り~support付きで設定しておく:~STREAMS#readablestream-set-up-with-byte-reading-support
11591160
取消~algo:~STREAMS#readablestream-set-up-cancelalgorithm
11601161
~pull~algo:~STREAMS#readablestream-set-up-pullalgorithm
1162+
RS.設定しておく:~STREAMS#readablestream-set-up
11611163
RS.読取器を取得する:~STREAMS#readablestream-get-a-reader
11621164
RS.~proxyを作成する:~STREAMS#readablestream-create-a-proxy
11631165
RS.~byte列から~pullする:~STREAMS#readablestream-pull-from-bytes
@@ -1171,15 +1173,15 @@
11711173
RS.妨げられている:~STREAMS#is-readable-stream-disturbed
11721174
RS.~lockされている:~STREAMS#readablestream-locked
11731175
RS.もっと~dataが必要:~STREAMS#readablestream-need-more-data
1176+
RS.通して~pipeする:~STREAMS#readablestream-pipe-through
11741177

11751178
RSR.~chunkを読取る:~STREAMS#readablestreamdefaultreader-read-a-chunk
11761179
RSR.すべての~byteを読取る:~STREAMS#readablestreamdefaultreader-read-all-bytes
11771180

1178-
RS.通して~pipeする:~STREAMS#readablestream-pipe-through
1179-
11801181
TS.設定しておく:~STREAMS#transformstream-set-up
11811182
TS.~chunkを~enqueueする:~STREAMS#transformstream-enqueue
11821183
恒等変換~stream:~STREAMS#identity-transform-stream
1184+
形式変換:~STREAMS#generictransformstream-transform
11831185

11841186

11851187
●Fetch API
@@ -1443,6 +1445,7 @@
14431445
~UTF-8符号化する:~ENCODING#utf-8-encode
14441446
~UTF-8復号する:~ENCODING#utf-8-decode
14451447
~BOMはそのままに~UTF-8復号する:~ENCODING#utf-8-decode-without-bom
1448+
~text復号器~streamを設定しておく:~ENCODING#set-up-a-text-decoder-stream
14461449

14471450
~URL:~URL1#concept-url
14481451
誤)~TR/pub-manifest/#dfn-url
@@ -2007,6 +2010,8 @@
20072010
%環境:environment
20082011
%模倣された言語:emulatedLanguage
20092012
%符号化-済みな模倣された言語:encodedEmulatedLanguage
2013+
%空な~stream:emptyStream
2014+
%復号器:decoder
20102015

20112016
●URL
20122017
hostname::::ホスト名
@@ -2575,6 +2580,7 @@
25752580
広く:widely-
25762581
見かけ:look
25772582
一定:constant
2583+
有無:presence
25782584

25792585
●●ref_key_map
25802586
ORIGIN:RFC6454
@@ -2734,7 +2740,7 @@
27342740

27352741
Commits:
27362742
https://github.com/whatwg/fetch/commits
2737-
<a href="https://fetch.spec.whatwg.org/commit-snapshots/301650c6d9ee932f126d6598262966242eb3d838/" id="commit-snapshot-link">Snapshot as of this commit</a>
2743+
<a href="https://fetch.spec.whatwg.org/commit-snapshots/30140d05af57eb9d24d43a2c18f108abac7964ce/" id="commit-snapshot-link">Snapshot as of this commit</a>
27382744
<a href="https://twitter.com/fetchstandard">@fetchstandard</a>
27392745

27402746
Tests:
@@ -21776,6 +21782,7 @@ <h3 title="Body mixin">5.3. `Body^I ~mixin</h3>
2177621782
[`NewObject$] `Promise$&lt;`FormData$I&gt; `formData$m();
2177721783
[`NewObject$] `Promise$&lt;`any$&gt; `json$m();
2177821784
[`NewObject$] `Promise$&lt;`USVString$&gt; `text$m();
21785+
[`NewObject$] `ReadableStream$I `textStream$m();
2177921786
};
2178021787
</pre>
2178121788

@@ -21892,6 +21899,14 @@ <h3 title="Body mixin">5.3. `Body^I ~mixin</h3>
2189221899
充足される~promiseを返す。
2189321900
2189421901
Returns a promise fulfilled with requestOrResponse’s body as string.
21902+
</dd>
21903+
21904+
<dt>%requestOrResponse . `textStream()$m</dt>
21905+
<dd>
21906+
%requestOrResponse の本体を文字列~chunkたちとして伴う
21907+
`ReadableStream$I ~objを返す。
21908+
21909+
Returns a ReadableStream object with requestOrResponse’s body as string chunks.
2189521910
</dd>
2189621911
</dl>
2189721912

@@ -22229,10 +22244,10 @@ <h3 title="Body mixin">5.3. `Body^I ~mixin</h3>
2222922244
`name$mF 属性の値 ~SET `filename^bl ~parameterの値
2223022245
</li>
2223122246
<li>
22232-
`type$mF 属性の値 ~SET %部位 内に `Content-Type$h ~headerが[
22247+
`type$mF 属性の値 ~SET %部位 内に `Content-Type$h ~headerが
22248+
⇒#
2223322249
在るならば その~header値 /
2223422250
無いならば `text/plain^bl ( `RFC7578$r § 4.4 に定義される既定)
22235-
2223622251
</li>
2223722252
</ul>
2223822253
@@ -22251,8 +22266,9 @@ <h3 title="Body mixin">5.3. `Body^I ~mixin</h3>
2225122266

2225222267
<p class="note">注記:
2225322268
これは、[
22254-
`Content-Type$h ~header / `charset^bl ~parameter
22255-
]の有無やその値に関わらず行われる。
22269+
`Content-Type$h ~headerの有無やその値,
22270+
`charset^bl ~parameterの有無やその値
22271+
]に関わらず,行われる。
2225622272
2225722273
This is done regardless of the presence or the value of a `Content-Type` header and regardless of the presence or the value of a `charset` parameter.
2225822274
</p>
@@ -22352,6 +22368,88 @@ <h3 title="Body mixin">5.3. `Body^I ~mixin</h3>
2235222368
2235322369
The text() method steps are to return the result of running consume body with this and UTF-8 decode.
2235422370
</p>
22371+
</div>
22372+
22373+
<div class="algo">
22374+
<p>
22375+
`textStream()@m
22376+
~method手続きは:
22377+
22378+
The textStream() method steps are:
22379+
</p>
22380+
<ol>
22381+
<li>
22382+
~IF[
22383+
コレは`利用-不能$Bdである
22384+
22385+
22386+
~THROW `TypeError$E
22387+
22388+
If this is unusable, then throw a TypeError.
22389+
</li>
22390+
<li>
22391+
<p>
22392+
~IF[
22393+
コレの`本体$Bd ~EQ ~NULL
22394+
]:
22395+
22396+
If this’s body is null:
22397+
</p>
22398+
<ol>
22399+
<li>
22400+
%空な~stream ~LET `新たな~obj$( `ReadableStream$I, コレに`関連な~realm$ )
22401+
22402+
Let emptyStream be a new ReadableStream in this’s relevant realm.
22403+
</li>
22404+
<li>
22405+
%空な~stream を`設定しておく$RS()
22406+
22407+
Set up emptyStream.
22408+
</li>
22409+
<li>
22410+
%空な~stream を`~closeする$RS()
22411+
22412+
Close emptyStream.
22413+
</li>
22414+
<li>
22415+
~RET %空な~stream
22416+
22417+
Return emptyStream.
22418+
</li>
22419+
</ol>
22420+
</li>
22421+
<li>
22422+
%~stream ~LET コレの`本体$Bdの`~stream$bd
22423+
22424+
Let stream be this’s body’s stream.
22425+
</li>
22426+
<li>
22427+
%復号器 ~LET `新たな~obj$( `TextDecoderStream$I, コレに`関連な~realm$ )
22428+
22429+
Let decoder be a new TextDecoderStream object in this’s relevant realm.
22430+
</li>
22431+
<li>
22432+
<p>
22433+
`~text復号器~streamを設定しておく$( %復号器, `~UTF-8$enc )
22434+
22435+
Set up decoder with UTF-8.
22436+
</p>
22437+
22438+
<p class="note">注記:
22439+
これは、[
22440+
`Content-Type$h ~headerの有無やその値,
22441+
`charset^bl ~parameterの有無やその値
22442+
]に関わらず,行われる。
22443+
22444+
This is done regardless of the presence or the value of a `Content-Type` header and regardless of the presence or the value of a `charset` parameter.
22445+
</p>
22446+
</li>
22447+
<li>
22448+
~RET %~stream を %復号器 【の`形式変換$】を`通して~pipeする$RS
22449+
22450+
Return the result of stream, piped through decoder.
22451+
</li>
22452+
</ol>
2235522453
</div>
2235622454

2235722455
</section>

0 commit comments

Comments
 (0)