<?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>26341</bug_id>
          
          <creation_ts>2014-07-15 18:43:32 +0000</creation_ts>
          <short_desc>file scheme without a base URL</short_desc>
          <delta_ts>2015-08-14 06:19:48 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>URL</component>
          <version>unspecified</version>
          <rep_platform>All</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>Unsorted</target_milestone>
          <dependson>25946</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Sapin">simon.sapin</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
    
    <cc>rubys</cc>
          
          <qa_contact>sideshowbarker+urlspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>108963</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Sapin">simon.sapin</who>
    <bug_when>2014-07-15 18:43:32 +0000</bug_when>
    <thetext>The parser’s scheme state contains:
&gt; If url&apos;s scheme is &quot;file&quot;, set state to relative state.

This can happen with a null (not given) base URL, but then the relative state goes on accessing components of the base URL:

&gt; &quot;?&quot;
&gt; Set url&apos;s host to base&apos;s host, url&apos;s port to base&apos;s port, url&apos;s path to base&apos;s path, url&apos;s query to the empty string, and state to query state.

Test cases:

new URL(&quot;file:&quot;)
new URL(&quot;file:?foo&quot;)
new URL(&quot;file:#foo&quot;)


The parsing algorithm could be clearer with a separate handling of file: URLs between the scheme state and the path/query/fragment states.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114569</commentid>
    <comment_count>1</comment_count>
    <who name="Sam Ruby">rubys</who>
    <bug_when>2014-11-05 21:34:48 +0000</bug_when>
    <thetext>http://intertwingly.net/projects/pegurl/url.html separates out file: URLs.  Should this approach be adopted, what more needs to be done here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122606</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-08-14 06:19:48 +0000</bug_when>
    <thetext>Thank you Simon. I fixed this with this commit, which introduces several new file-specific states:

https://github.com/whatwg/url/commit/09cd673a338e7abc552140d950c4f34d7d71362a

It also resolves a number of other issues around file URLs, though it&apos;ll still need more verification and tests.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>