<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>16728</bug_id>
          
          <creation_ts>2012-04-13 12:00:19 +0000</creation_ts>
          <short_desc>Blob.type</short_desc>
          <delta_ts>2012-05-07 06:46:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>File API</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>16950</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Arun">arun</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>glenn</cc>
    
    <cc>public-webapps</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66688</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-13 12:00:19 +0000</bug_when>
    <thetext>&quot;The ASCII-encoded string in lower case representing the media type of the Blob&quot;

DOMStrings aren&apos;t ASCII-encoded. If type was set with the Blob() constructor, it isn&apos;t necessarily in lowercase, either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66692</commentid>
    <comment_count>1</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2012-04-13 13:53:30 +0000</bug_when>
    <thetext>Is the intent for it to be restricted to the ASCII subset, and/or converted to lowercase in the ctor?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66771</commentid>
    <comment_count>2</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2012-04-17 19:57:29 +0000</bug_when>
    <thetext>I looked at RFC2046 and at the HTML5 specification, which</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66772</commentid>
    <comment_count>3</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2012-04-17 19:59:32 +0000</bug_when>
    <thetext>*sigh Sorry for Comment 2; I submitted too soon.

I looked at RFC2046 and at the HTML5 specification, which defines a valid MIME type string as matching RFC2616&apos;s media types section (3.7), to see if MIME type strings themselves are restricted to ASCII.  They aren&apos;t as far as I can tell, and so we shouldn&apos;t have this requirement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66773</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-04-17 20:14:30 +0000</bug_when>
    <thetext>RFC 2616 section 3.7 says:

       media-type     = type &quot;/&quot; subtype *( &quot;;&quot; parameter )
       type           = token
       subtype        = token

Section 2.2 says:

       token          = 1*&lt;any CHAR except CTLs or separators&gt;

Section 2.2 says:

       CHAR           = &lt;any US-ASCII character (octets 0 - 127)&gt;

So MIME types are in fact restricted to ASCII.  Furthermore, they&apos;re restricted to a subset of ASCII: &quot;except CTLs or separators&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66774</commentid>
    <comment_count>5</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2012-04-17 20:44:39 +0000</bug_when>
    <thetext>So my first reading was right, which is why the requirement was there.  But it&apos;s true that DOMStrings aren&apos;t ASCII-encoded.  We may as well ignore this, and do what we do for invalid MIME types on the platform in general.  Otherwise maybe we&apos;d have to specify that:

1. Implementations throw if type is set with &quot;invalid&quot; non-ASCII chars
2. Specify that implementations do case conversion, if necessary.

Don&apos;t know if we can really do those.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66775</commentid>
    <comment_count>6</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-04-17 21:17:06 +0000</bug_when>
    <thetext>&gt; do what we do for invalid MIME types on the platform in general.

It probably varies.  At least some implementations, in some cases, byte-deflate and ASCII-lowercase.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66781</commentid>
    <comment_count>7</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-04-18 07:02:55 +0000</bug_when>
    <thetext>We can do that in the Blob constructor and in Blob.slice (and anywhere else where Blobs are created with an author-specified MIME type).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67371</commentid>
    <comment_count>8</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2012-05-07 05:05:16 +0000</bug_when>
    <thetext>Marking this fixed.  http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>