W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: [FileAPI] File.slice spec bug

From: Kyle Huey <me@kylehuey.com>
Date: Tue, 12 Apr 2011 13:14:39 -0700
Message-ID: <BANLkTikNtXfKkeOC9O79WRPSpgPwzcHosQ@mail.gmail.com>
To: Jian Li <jianli@chromium.org>
Cc: "arun@mozilla.com" <arun@mozilla.com>, Darin Fisher <darin@chromium.org>, Maciej Stachowiak <mjs@apple.com>, Jonas Sicking <jonas@sicking.cc>, Web Applications Working Group WG <public-webapps@w3.org>, Eric Uhrhane <ericu@google.com>, "dimich@chromium.org" <dimich@chromium.org>
File.slice was first supported in Firefox 4.

- Kyle

On Tue, Apr 12, 2011 at 1:08 PM, Jian Li <jianli@chromium.org> wrote:

> The biggest concern is that this is a breaking change and quite a few web
> applications have already been using it. As far as I know, File.slice(start,
> length) has been supported as early as Chrome 6 and Safari 5. Also Firefox 3
> is supporting it. How do we communicate with web developers about this
> breaking change if we decide to make the change?
>
> Jian
>
>
> On Tue, Apr 12, 2011 at 11:34 AM, Arun Ranganathan <arun@mozilla.com>wrote:
>
>> On 4/12/11 2:24 PM, Jonas Sicking wrote:
>>
>>> Hi All,
>>>
>>> It was recently (yesterday) pointed out to me that we let a bad
>>> spec-bug slip through for File.slice. It doesn't match the argument
>>> semantics of Array.slice which can be very confusing for developers.
>>>
>>> In Array.slice the second argument is the index of the last item to be
>>> included in the returned slice.
>>> In File.slice the second argument is the number of bytes included in
>>> the returned slices.
>>>
>>> In other words, it's Array.slice(start, end), but File.slice(start,
>>> length).
>>>
>>> Additionally, in Array.slice the second argument is optional.
>>>
>>> File.slice is currently shipped by Chrome and Firefox 4. I would be
>>> fine with fixing this in Firefox 4.0.1, however that only makes sense
>>> if the chrome folks are fine with fixing it in their implementation.
>>>
>>> So consider this an official request, would chrome be ok with changing
>>> the spec here?
>>>
>>> / Jonas
>>>
>>>
>> I'm bummed that we collectively let this slip through the cracks, and
>> personally think it's early enough to fix it.  But we should also decide how
>> closely to match Array.slice.  Should we allow code of the sort
>>
>> file.slice(-80)?
>>
>> Code of that sort is allowed with Array.slice.
>>
>> MDC has good developer docs about what's in Firefox for Array.slice:
>>
>>
>> https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/slice
>>
>> Developers may have already discovered file.slice (e.g. see
>> http://hacks.mozilla.org/2011/04/resumeupload/), so fixing this will
>> involve some messaging.
>>
>> -- A*
>>
>>
>
Received on Tuesday, 12 April 2011 20:15:07 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:44 GMT