W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

Re: [File API] Blob.slice()

From: Arun Ranganathan <arun@mozilla.com>
Date: Tue, 30 Aug 2011 21:17:17 -0700
Message-ID: <4E5DB5CD.7060404@mozilla.com>
To: Anne van Kesteren <annevk@opera.com>
CC: WebApps WG <public-webapps@w3.org>
On 8/14/11 5:42 AM, Anne van Kesteren wrote:
> Why does the slice() method use [TreatUndefinedAs=EmptyString]? Can it 
> not just use the normal default handling? Also, if you do indeed want 
> to use that saying "If the contentType parameter is undefined, let 
> relativeContentType be set to the empty string." in the text is 
> redundant and ought to be removed.

Default handling doesn't treat undefined as the empty string AFAICT.  
The redundancy is instructive.
> The slice() method definition does not state what happens when the 
> contentType parameter is neither the empty string nor a valid media type.

I'm not sure we need to mention this.  Developers can do things with 
this argument that could cause their Blob objects to be handled weirdly 
by downstream APIs (e.g. "foo-baz/bas").  I'm really not sure what 
exactly we can say here; I can put in a warning or note.

> The definition of the slice() method is also very confusing with 
> several MUST statements. I think it would be better if it were defined 
> as a single algorithm in line with how we normally define methods.

It's defined as a single algorithm:


and cribs from ECMAScript's definition of slice.  It's the only host 
object with a slice.

-- A*
Received on Wednesday, 31 August 2011 04:17:46 UTC

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