<?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>23431</bug_id>
          
          <creation_ts>2013-10-03 14:35:55 +0000</creation_ts>
          <short_desc>File API should say what to do with the query string in blob: URLs</short_desc>
          <delta_ts>2013-11-17 00:01:05 +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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Arun">arun</reporter>
          <assigned_to name="Arun">arun</assigned_to>
          <cc>annevk</cc>
    
    <cc>glenn</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94231</commentid>
    <comment_count>0</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-10-03 14:35:55 +0000</bug_when>
    <thetext>Currently, the File API mentions what can be done with the fragment identifier, but doesn&apos;t say anything about the query string.

The File API should mention that blob: URLs should explicitly ignore the query string.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94654</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-10-14 13:25:32 +0000</bug_when>
    <thetext>Should we at some point move all this logic to Fetch? I.e. you define how to create the URL, Fetch defines how to obtain from a blob URL?

Or should Fetch provide a hook for your specification?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94658</commentid>
    <comment_count>2</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-10-14 15:05:17 +0000</bug_when>
    <thetext>One &quot;pro&quot; of moving everything to Fetch would be to have a central place to accommodate all the (proliferating) schemes.  For instance, File API defines request-response behavior for the blob: scheme, much of which is reproduced in mediastream: URLs.  Then, the FileSystem API will define the filesystem: scheme, which is currently implemented in Chrome, and which the specification will standardize.  If all of it is routed via Fetch, we&apos;ll have a single normative source for URL dereferencing.

But I&apos;m not *strongly* opinionated on this, and don&apos;t mind the solution of it living in separate specifications.  For &quot;LC&quot; purposes, the File API will define blob: and maybe successor drafts (including Fetch) can deal with the protocol as it evolves (hopefully not too much).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95642</commentid>
    <comment_count>3</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-10-31 22:37:11 +0000</bug_when>
    <thetext>Fixed.
http://dev.w3.org/2006/webapi/FileAPI/#queryString</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95652</commentid>
    <comment_count>4</comment_count>
    <who name="Glenn Maynard">glenn</who>
    <bug_when>2013-11-01 02:34:31 +0000</bug_when>
    <thetext>I don&apos;t think it needs to say anything.  Specs say what to do, not what not to do; if it doesn&apos;t say to do anything with the query parameter, then nothing is done with the query parameter.

The language now in the spec is confusing: it doesn&apos;t clearly mean anything, and might be interpreted to mean something wrong.  For example, if you parse a blob URL with new URL(blobURL), clearly the .search attribute of the result should include the query, even if it&apos;s a blob URL.  The vague language &quot;must ignore a query string&quot; might be interpreted to contradict that, as if the file API spec is implicitly monkey-patching the URL spec.

If the intent is to ensure that appending &quot;?foo&quot; to a blob URL doesn&apos;t affect resolving the resource, then you probably just want to define which parts of the parsed URL are the unique identifier.  With the URL spec&apos;s terminology, it looks like the identifying part is the &quot;scheme data&quot; (which doesn&apos;t include the query or the fragment).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95669</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-11-01 11:44:57 +0000</bug_when>
    <thetext>Indeed, the way to fix this is to define blob URLs in terms of http://url.spec.whatwg.org/ and not in ABNF as that will not be used for parsing them anyway once http://url.spec.whatwg.org/ is implemented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95699</commentid>
    <comment_count>6</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-11-01 17:36:18 +0000</bug_when>
    <thetext>(In reply to Glenn Maynard from comment #4)
&gt; I don&apos;t think it needs to say anything.  Specs say what to do, not what not
&gt; to do; if it doesn&apos;t say to do anything with the query parameter, then
&gt; nothing is done with the query parameter.
&gt; 
&gt; The language now in the spec is confusing: it doesn&apos;t clearly mean anything,
&gt; and might be interpreted to mean something wrong.  For example, if you parse
&gt; a blob URL with new URL(blobURL), clearly the .search attribute of the
&gt; result should include the query, even if it&apos;s a blob URL.  The vague
&gt; language &quot;must ignore a query string&quot; might be interpreted to contradict
&gt; that, as if the file API spec is implicitly monkey-patching the URL spec.
&gt; 
&gt; If the intent is to ensure that appending &quot;?foo&quot; to a blob URL doesn&apos;t
&gt; affect resolving the resource, then you probably just want to define which
&gt; parts of the parsed URL are the unique identifier.  With the URL spec&apos;s
&gt; terminology, it looks like the identifying part is the &quot;scheme data&quot; (which
&gt; doesn&apos;t include the query or the fragment).

I agree with this comment, and have changed the spec. to reflect this feedback.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95700</commentid>
    <comment_count>7</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-11-01 17:37:53 +0000</bug_when>
    <thetext>(In reply to Anne from comment #5)
&gt; Indeed, the way to fix this is to define blob URLs in terms of
&gt; http://url.spec.whatwg.org/ and not in ABNF as that will not be used for
&gt; parsing them anyway once http://url.spec.whatwg.org/ is implemented.

I think reworking this for blob: isn&apos;t useful, since it&apos;s a simple enough scheme without any real components.  But url.spec.whatwg.org will be what the filesystem: scheme should be defined based on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95701</commentid>
    <comment_count>8</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-11-01 17:41:43 +0000</bug_when>
    <thetext>Arun, all URLs should be defined and created equal. There&apos;s only one URL parser after all.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95830</commentid>
    <comment_count>9</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-11-05 21:09:44 +0000</bug_when>
    <thetext>(In reply to Anne from comment #8)
&gt; Arun, all URLs should be defined and created equal. There&apos;s only one URL
&gt; parser after all.

Yes, but blob: is already in implementations and shipping, and I&apos;m not clear exactly what you&apos;re suggesting.  We already defer to fetch for parts of blob: URL ref culling.  So:

1. Are you suggesting that url.spec.whatwg.org adds other schemes to the existing scheme list in Section 5 (that is, http://url.spec.whatwg.org/#urls)?  If so, I support that, and think you may as well add some riders such as mediastream:, which ought to behave exactly like blob: as far as schemes go, since mediastream: is essentially blob: by another name.  Then, when that becomes authoritative, we should deprecate what I have in the File API (which itself may be deprecated by any specs that emerge out of the ongoing discussion about Streams).

2. Or, are you suggesting I rewrite the blob: definition in terms of url.spec.whatwg.org in the File API spec.?  That would have been useful feedback a bit earlier in the game.  I&apos;m not totally sure what it buys us now.  Implementations are still free to use &quot;one URL parser.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>95856</commentid>
    <comment_count>10</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-11-06 10:41:17 +0000</bug_when>
    <thetext>I don&apos;t think you understand. The URL Standard already defines parsing for all URLs. Relative schemes are treated specially, but for all other schemes the URL ends up as &quot;scheme&quot;, &quot;scheme data&quot;, &quot;query&quot;, and &quot;fragment&quot;.

To define blob URLs in terms of this you just have to say what the &quot;scheme data&quot; can be (if you want to restrict the code points for producers), maybe that a conforming blob URL does not have a query and that fragment can be anything. (Reworded in specification prose of course.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96412</commentid>
    <comment_count>11</comment_count>
    <who name="Arun">arun</who>
    <bug_when>2013-11-17 00:01:05 +0000</bug_when>
    <thetext>(In reply to Anne from comment #10)
&gt; I don&apos;t think you understand. The URL Standard already defines parsing for
&gt; all URLs. Relative schemes are treated specially, but for all other schemes
&gt; the URL ends up as &quot;scheme&quot;, &quot;scheme data&quot;, &quot;query&quot;, and &quot;fragment&quot;.
&gt; 
&gt; To define blob URLs in terms of this you just have to say what the &quot;scheme
&gt; data&quot; can be (if you want to restrict the code points for producers), maybe
&gt; that a conforming blob URL does not have a query and that fragment can be
&gt; anything. (Reworded in specification prose of course.)

OK, fixed per your suggestions.

http://dev.w3.org/2006/webapi/FileAPI/#DefinitionOfScheme

Reopen if necessary.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>