Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More tests for file URL Window drive letter quirk #4382

Merged
merged 4 commits into from
Jan 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions url/a-element-origin-xhtml.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
<script src="a-element-origin.js"></script>
</body>
</html>
<!-- Other dependencies: urltestdata.json -->
1 change: 1 addition & 0 deletions url/a-element-origin.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
<base id=base>
<div id=log></div>
<script src=a-element-origin.js></script>
<!-- Other dependencies: urltestdata.json -->
1 change: 1 addition & 0 deletions url/a-element-xhtml.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
<script src="a-element.js"></script>
</body>
</html>
<!-- Other dependencies: urltestdata.json -->
1 change: 1 addition & 0 deletions url/a-element.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
<base id=base>
<div id=log></div>
<script src=a-element.js></script>
<!-- Other dependencies: urltestdata.json -->
71 changes: 71 additions & 0 deletions url/urltestdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4647,5 +4647,76 @@
"pathname": "/",
"search": "",
"hash": ""
},
"# More file URL tests by zcorpan",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we put the author here? Should I do that too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just wanted to separate these tests from the ones above to direct any blame at me, but of course git blame works too. Can remove it though.

{
"input": "/",
"base": "file:///C:/a/b",
"href": "file:///C:/",
"protocol": "file:",
"username": "",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pathname should be "/C:/" not "/"

"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/C:/",
"search": "",
"hash": ""
},
{
"input": "//d:",
"base": "file:///C:/a/b",
"href": "file:///d:",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should end in a slash, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://url.spec.whatwg.org/#file-state "/"
https://url.spec.whatwg.org/#file-slash-state "/"
https://url.spec.whatwg.org/#file-host-state "d:" appended to buffer, then EOF. Buffer is a Windows drive letter.
https://url.spec.whatwg.org/#path-state step 1.4.2 appends buffer to path, without adding a trailing slash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems correct, but then pathname wouldn't end in a "/" either. It's also not entirely clear to me that is the desired outcome.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pathname should be "/d:" not "/d:/"

"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/d:",
"search": "",
"hash": ""
},
{
"input": "//d:/..",
"base": "file:///C:/a/b",
"href": "file:///d:/",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/d:/",
"search": "",
"hash": ""
},
{
"input": "..",
"base": "file:///ab:/",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
},
{
"input": "..",
"base": "file:///1:/",
"href": "file:///",
"protocol": "file:",
"username": "",
"password": "",
"host": "",
"hostname": "",
"port": "",
"pathname": "/",
"search": "",
"hash": ""
}
]