Skip to content

Commit

Permalink
URL: file URLs and path (back) slashes
Browse files Browse the repository at this point in the history
Closes #4762 by superseding it.

URL Standard: whatwg/url#232.
  • Loading branch information
annevk committed Mar 22, 2017
1 parent ca6d3ae commit 94969f1
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 0 deletions.
27 changes: 27 additions & 0 deletions url/setters_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,33 @@
"href": "sc://example.net/%23",
"pathname": "/%23"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file://monkey/",
"new_value": "\\\\",
"expected": {
"href": "file://monkey/",
"pathname": "/"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file:///unicorn",
"new_value": "//\\/",
"expected": {
"href": "file:///",
"pathname": "/"
}
},
{
"comment": "File URLs and (back)slashes",
"href": "file:///unicorn",
"new_value": "//monkey/..//",
"expected": {
"href": "file:///",
"pathname": "/"
}
}
],
"search": [
Expand Down
169 changes: 169 additions & 0 deletions url/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5137,6 +5137,175 @@
"search": "?test",
"hash": "#x"
},
"# File URLs and many (back)slashes",
{
"input": "file:\\\\//",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:\\\\\\\\",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file://spider///",
"base": "about:blank",
"href": "file://spider/",
"protocol": "file:",
"username": "",
"password": "",
"host": "spider",
"hostname": "spider",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:\\\\localhost//",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "file:///localhost//cat",
"base": "about:blank",
"href": "file:///localhost//cat",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/localhost//cat",
"search": "",
"hash": ""
},
{
"input": "file://\\/localhost//cat",
"base": "about:blank",
"href": "file:///localhost//cat",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/localhost//cat",
"search": "",
"hash": ""
},
{
"input": "file://localhost//a//../..//",
"base": "about:blank",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "/////mouse",
"base": "file:///elephant",
"href": "file:///mouse",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/mouse",
"search": "",
"hash": ""
},
{
"input": "\\//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "\\/localhost//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "//localhost//pig",
"base": "file://lion/",
"href": "file:///pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/pig",
"search": "",
"hash": ""
},
{
"input": "/..//localhost//pig",
"base": "file://lion/",
"href": "file://lion/localhost//pig",
"protocol": "file:",
"username": "",
"password": "",
"host": "lion",
"hostname": "lion",
"port": "",
"pathname": "/localhost//pig",
"search": "",
"hash": ""
},
"# Windows drive letter quirk with not empty host",
{
"input": "file://example.net/C:/",
Expand Down

0 comments on commit 94969f1

Please sign in to comment.