Re: File API and Directory API feedback

On Thu, Feb 10, 2011 at 6:27 PM, Ian Hickson <ian@hixie.ch> wrote:

> * Is Blob.size supposed to be synchronous? I'm looking into adding a way
> to get a Blob from <canvas>, but trying to avoid the mistake I made with
> toDataURL of having the data be synchronously available. That's fine with
> Blob and FileReader, the data can be read async, but the browser won't
> know the size of the file ahead of time, which means that I guess I should
> have a callback to get the Blob? It seems sad that we need to be async
> both in getting the Blob _and_ in getting the data from the Blob.
>

You need to know the size of a Blob for the Blob's own synchronous API to
work.  In particular, Blob.slice needs to know the blob's size to clamp its
parameters.

-- 
Glenn Maynard

Received on Friday, 11 February 2011 01:23:52 UTC