@@ -572,45 +572,34 @@ It must act as follows:
572572### The {{Blob/stream()}} method ### {#stream-method-algo}
573573
574574The <dfn method for=Blob>stream()</dfn> method, when invoked, must return
575- the result of [=getting a stream for a Blob=] for the [=context object=] .
576-
577- To <dfn lt="get a stream for a Blob|getting a stream for a Blob">get a stream for a {{Blob}}</dfn>
578- |blob|, run the following steps:
579-
580- 1. Let |stream| be the result of [=construct a ReadableStream object|constructing=] a
581- {{ReadableStream}} object.
582- 1. Run the following steps [=in parallel=] :
583- 1. While not all bytes of |blob| have been read:
584- 1. Let |bytes| be the byte sequence that results from reading a [=chunk=] from |blob|.
585- 1. If a [=file read error=] occured while reading |bytes|, [$ReadableStream/error$]
586- |stream| with a [=failure reason=] and abort these steps.
587- 1. [=ReadableStream/Enqueue=] |bytes| into |stream|.
588-
589- Issue: We need to specify more concretely what reading from a Blob actually does,
590- and what possible errors can happen.
591- 1. Return |stream|.
575+ the result of calling [=get stream=] on the [=context object=] .
592576
593577### The {{Blob/text()}} method ### {#text-method-algo}
594578
595579The <dfn method for=Blob>text()</dfn> method, when invoked, must run these steps:
596580
597- 1. Let |stream| be the the result of [=getting a stream for a Blob =] for the [=context object=] .
581+ 1. Let |stream| be the result of calling [=get stream=] on the [=context object=] .
5985821. Let |reader| be the result of [=get a reader|getting a reader=] from |stream|.
599583 If that threw an exception, return a new promise rejected with that exception.
6005841. Let |promise| be the result of [=read all bytes|reading all bytes=] from |stream| with |reader|.
6015851. Return the result of transforming |promise| by a fulfillment handler that returns the result of
602586 running [=UTF-8 decode=] on its first argument.
603587
588+ Note: This is different from the behavior of {{FileReader/readAsText()}} to align better
589+ with the behavior of {{Body/text()|Body.text()}} . Specifically this method will always
590+ use UTF-8 as encoding, while {{FileReader}} can use a different encoding depending on
591+ the blob's type and passed in encoding name.
592+
604593### The {{Blob/arrayBuffer()}} method ### {#arraybuffer-method-algo}
605594
606595The <dfn method for=Blob>arrayBuffer()</dfn> method, when invoked, must run these steps:
607596
608- 1. Let |stream| be the the result of [=getting a stream for a Blob =] for the [=context object=] .
597+ 1. Let |stream| be the result of calling [=get stream=] on the [=context object=] .
6095981. Let |reader| be the result of [=get a reader|getting a reader=] from |stream|.
610599 If that threw an exception, return a new promise rejected with that exception.
6116001. Let |promise| be the result of [=read all bytes|reading all bytes=] from |stream| with |reader|.
6126011. Return the result of transforming |promise| by a fulfillment handler that returns
613- a new {{ArrayBuffer} whose contents are its first argument.
602+ a new {{ArrayBuffer}} whose contents are its first argument.
614603
615604<!--
616605████████ ████ ██ ████████
0 commit comments