W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: Is BlobBuilder needed?

From: Ojan Vafai <ojan@chromium.org>
Date: Tue, 25 Oct 2011 13:37:51 -0700
Message-ID: <CANMdWTtHbby_5LDr9Y_V1tRA5ZrbufY+cHFqqvN9SLxaqXPA-Q@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Michael Nordman <michaeln@google.com>, Jonas Sicking <jonas@sicking.cc>, Erik Arvidsson <arv@chromium.org>, Eric U <ericu@google.com>, Webapps WG <public-webapps@w3.org>
On Tue, Oct 25, 2011 at 12:57 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Tue, Oct 25, 2011 at 12:53 PM, Ojan Vafai <ojan@chromium.org> wrote:
> > The new API is smaller and simpler. Less to implement and less for web
> > developers to understand. If it can meet all our use-cases without
> > significant performance problems, then it's a win and we should do it.
> >
> > For line-endings, you could have the Blob constructor also take an
> optional
> > endings argument:
> > new Blob(String|Array|Blob|ArrayBuffer data, [optional] String
> contentType,
> > [optional] String endings);
> I believe (or at least, I maintain) that we're trying to do
> dictionaries for this sort of thing.  Multiple optional arguments are
> *horrible* unless they are truly, actually, order-dependent such that
> you wouldn't ever specify a later one without already specifying a
> former one.

I agree actually. So, it could be any of the following:
1. new Blob(data, [optional] options)
2. new Blob(options, data...)
3. new Blob([optional] dataAndOptions)

I don't feel strongly, but option 1 seems best to me since it allows simple
usages like 'new Blob("foo")'. On the other hand, option 2 lets you not have
to create an array to append multiple elements to the Blob.
Received on Tuesday, 25 October 2011 20:38:36 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:36 UTC