Re: [w3c/FileAPI] Re-add readAsBinaryString() (#44)

> +1. If {{FileReader/readyState}} = {{FileReader/LOADING}} throw an {{InvalidStateError}} exception and <a>terminate this algorithm</a>.
> +2. If the <code>blob</code> is in the <a for="Blob/readability state">CLOSED</a> <a>readability state</a>,
> +  set the {{error!!attribute}} attribute of the <a>context object</a>
> +  to return an {{InvalidStateError}} exception
> +  and <a>fire a progress event</a> called {{error!!event}} at the <a>context object</a>.
> +  <a>Terminate this algorithm</a>.
> +3. Otherwise set {{FileReader/readyState}} to {{FileReader/LOADING}}.
> +4. Initiate an <a>annotated task read operation</a> using the <code>blob</code> argument as <var>input</var>
> +  and handle <a lt="queue a task">tasks queued</a> on the <a>file reading task source</a> per below.
> +5. To <a>process read error</a> with a <a>failure reason</a>,
> +  proceed to the [[#dfn-error-steps]].
> +6. To <a>process read</a> <a>fire a progress event</a> called {{loadstart}} at the <a>context object</a>.
> +7. To <a>process read data</a> <a>fire a progress event</a> called {{progress}} at the <a>context object</a>.
> +8. To <a>process read EOF</a> run these substeps:
> +  1. Set {{FileReader/readyState}} to {{FileReader/DONE}}
> +  2. Set the {{FileReader/result}} attribute to the <a>body</a> returned by the <a>read operation</a> as a <a>binary string</a>.

I found this particularly confusing. Having this be some kind of operation that ends up converting bytes to a string would make it clearer. Currently it seems to invoke a non-normative description of "binary string"...

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/pull/44/files/f1eed7b9387c9f03bf37dd1d5fd340efa5bc7a6a#r71191030

Received on Monday, 18 July 2016 17:30:39 UTC