Re: [File API] Blob.slice()

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:

http://dev.w3.org/2006/webapi/FileAPI/#dfn-slice

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