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

Re: [FileAPI] File.slice spec bug

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 12 Apr 2011 16:48:43 -0700
Message-ID: <BANLkTi=guo86dh2iCs3qqevmq=vbxj+_=g@mail.gmail.com>
To: Glenn Maynard <glenn@zewt.org>
Cc: Webapps WG <public-webapps@w3.org>
On Tue, Apr 12, 2011 at 3:22 PM, Glenn Maynard <glenn@zewt.org> wrote:
> On Tue, Apr 12, 2011 at 5:35 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> No, but feature testing only when you're about to use the function
>> shouldn't be a problem, no?
>
> I'd much rather be able to detect this once, in a self-contained,
> code-and-forget backwards-compatibility block, for example something like:
>
> (function() {
>     var bb = new BlobBuilder();
>     bb.append("abcd");
>     if(bb.getBlob().slice(2, 2).size == 2)
>     {
>         var origSlice = Blob.prototype.slice;
>         Blob.prototype.slice = function(start, end) { return
> origSlice.apply(this, [start, end - start]); }
>     }
> })();
>
> I could monkey patch slice to do this test each time, of course, but then
> instead of a nasty monkey patch only applied on old browsers, it'd be
> applied to every browser.

Well, given that I can get a fix into Firefox 4.0.1 then Firefox won't
be a problem.

So the question is if we can convinced the Chrome/Opera guys to take
this change. I think the best thing would otherwise be to remove
.slice() entirely and replace it with something else to remove
confusion.

/ Jonas
Received on Tuesday, 12 April 2011 23:57:41 GMT

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