W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2011

Re: File API and Directory API feedback

From: Glenn Maynard <glenn@zewt.org>
Date: Thu, 10 Feb 2011 20:23:18 -0500
Message-ID: <AANLkTik33jVdesUbcehSTmcd_fF3M_LaQ4OvyEG_+_=f@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: public-webapps@w3.org
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

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:16 UTC