зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1694058 [wpt PR 27720] - [URL] Ensure that path-only URLs do not have their paths erased by th…, a=testonly
Automatic update from web-platform-tests URL: pathname setter should not erase path-only URL paths For https://github.com/whatwg/url/pull/582. Co-authored-by: Anne van Kesteren <annevk@annevk.nl> -- wpt-commits: 77d54aa9e0405f737987b59331f3584e3e1c26f9 wpt-pr: 27720
This commit is contained in:
Родитель
7b2bb69b24
Коммит
615cc1044e
|
@ -1611,6 +1611,51 @@
|
|||
"pathname": "me@example.net"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Special URLs cannot have their paths erased",
|
||||
"href": "file:///some/path",
|
||||
"new_value": "",
|
||||
"expected": {
|
||||
"href": "file:///",
|
||||
"pathname": "/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Non-special URLs can have their paths erased",
|
||||
"href": "foo://somehost/some/path",
|
||||
"new_value": "",
|
||||
"expected": {
|
||||
"href": "foo://somehost",
|
||||
"pathname": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Non-special URLs with an empty host can have their paths erased",
|
||||
"href": "foo:///some/path",
|
||||
"new_value": "",
|
||||
"expected": {
|
||||
"href": "foo://",
|
||||
"pathname": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Path-only URLs cannot have their paths erased",
|
||||
"href": "foo:/some/path",
|
||||
"new_value": "",
|
||||
"expected": {
|
||||
"href": "foo:/",
|
||||
"pathname": "/"
|
||||
}
|
||||
},
|
||||
{
|
||||
"comment": "Path-only URLs always have an initial slash",
|
||||
"href": "foo:/some/path",
|
||||
"new_value": "test",
|
||||
"expected": {
|
||||
"href": "foo:/test",
|
||||
"pathname": "/test"
|
||||
}
|
||||
},
|
||||
{
|
||||
"href": "unix:/run/foo.socket?timeout=10",
|
||||
"new_value": "/var/log/../run/bar.socket",
|
||||
|
|
Загрузка…
Ссылка в новой задаче