Bug 17449 - It is unclear to set type to be lower case in Blob constructor.
It is unclear to set type to be lower case in Blob constructor.
Status: RESOLVED INVALID
Product: WebAppsWG
Classification: Unclassified
Component: File API
unspecified
PC Windows NT
: P2 normal
: ---
Assigned To: Arun
public-webapps-bugzilla
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-09 03:39 UTC by Li Yin
Modified: 2012-06-13 05:34 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li Yin 2012-06-09 03:39:35 UTC
From spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-BlobPropertyBag

Convert every character in s to lower case.

Does it mean we need set characters of Blob.type into lower case?
Or the lower-case conversion is just for obtaining the media-type, and Blob.type is still unchanged.

For example:
(new Blob([], {type: "text/html; charset=UTF-8"})).type
should be return:  text/html; charset=utf-8  or   text/html; charset=UTF-8  ?
Comment 1 Yang Sun 2012-06-11 15:23:40 UTC
MIME type is usually in lower case, just a routine. In email, in RTP, in http, it is always in lower case.

And convert all to lower case,just avoid error in processing.

I think nothing else.

(In reply to comment #0)
> From spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-BlobPropertyBag
> 
> Convert every character in s to lower case.
> 
> Does it mean we need set characters of Blob.type into lower case?
> Or the lower-case conversion is just for obtaining the media-type, and
> Blob.type is still unchanged.
> 
> For example:
> (new Blob([], {type: "text/html; charset=UTF-8"})).type
> should be return:  text/html; charset=utf-8  or   text/html; charset=UTF-8  ?
Comment 2 Kentaro Hara 2012-06-12 00:55:41 UTC
(In reply to comment #1)
> MIME type is usually in lower case, just a routine. In email, in RTP, in http,
> it is always in lower case.
> 
> And convert all to lower case,just avoid error in processing.

I agree that "text/html; charset=UTF-8" should be converted to "text/html; charset=utf-8" when parsing the MIME type. My question is whether we should set the converted value to type or not.

IMHO, returning "text/html; charset=utf-8" for (new Blob([], {type: "text/html; charset=UTF-8"})).type seems a bit strange. (Do we have another example that does such an implicit conversion?)
Comment 3 Li Yin 2012-06-13 05:34:28 UTC
From Spec: http://dev.w3.org/2006/webapi/FileAPI/#attributes-blob
The ASCII-encoded string in lower case representing the media type of the Blob.

It explicitly specified the type should be lower case.

Mark the bug to be INVALID.