This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The parser’s scheme state contains: > If url's scheme is "file", 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: > "?" > Set url's host to base's host, url's port to base's port, url's path to base's path, url's query to the empty string, and state to query state. Test cases: new URL("file:") new URL("file:?foo") new URL("file:#foo") The parsing algorithm could be clearer with a separate handling of file: URLs between the scheme state and the path/query/fragment states.
http://intertwingly.net/projects/pegurl/url.html separates out file: URLs. Should this approach be adopted, what more needs to be done here?
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'll still need more verification and tests.