diff --git a/dom/base/Link.cpp b/dom/base/Link.cpp index 1f2c381a0a2a..af8e4d38def2 100644 --- a/dom/base/Link.cpp +++ b/dom/base/Link.cpp @@ -139,10 +139,19 @@ void Link::SetProtocol(const nsAString& aProtocol) { // Ignore failures to be compatible with NS4. return; } - uri = net::TryChangeProtocol(uri, aProtocol); - if (!uri) { + + nsAString::const_iterator start, end; + aProtocol.BeginReading(start); + aProtocol.EndReading(end); + nsAString::const_iterator iter(start); + (void)FindCharInReadable(':', iter, end); + nsresult rv = NS_MutateURI(uri) + .SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter))) + .Finalize(uri); + if (NS_FAILED(rv)) { return; } + SetHrefAttribute(uri); } diff --git a/dom/url/URL.cpp b/dom/url/URL.cpp index 799bb72cffbb..933ebc91c5ea 100644 --- a/dom/url/URL.cpp +++ b/dom/url/URL.cpp @@ -233,14 +233,38 @@ void URL::GetProtocol(nsAString& aProtocol) const { } void URL::SetProtocol(const nsAString& aProtocol) { - nsCOMPtr uri(URI()); - if (!uri) { + nsAString::const_iterator start; + aProtocol.BeginReading(start); + + nsAString::const_iterator end; + aProtocol.EndReading(end); + + nsAString::const_iterator iter(start); + FindCharInReadable(':', iter, end); + + // Changing the protocol of a URL, changes the "nature" of the URI + // implementation. In order to do this properly, we have to serialize the + // existing URL and reparse it in a new object. + nsCOMPtr clone; + nsresult rv = NS_MutateURI(URI()) + .SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter))) + .Finalize(clone); + if (NS_WARN_IF(NS_FAILED(rv))) { return; } - uri = net::TryChangeProtocol(uri, aProtocol); - if (!uri) { + + nsAutoCString href; + rv = clone->GetSpec(href); + if (NS_WARN_IF(NS_FAILED(rv))) { return; } + + nsCOMPtr uri; + rv = NS_NewURI(getter_AddRefs(uri), href); + if (NS_WARN_IF(NS_FAILED(rv))) { + return; + } + mURI = std::move(uri); } diff --git a/dom/url/tests/test_url.html b/dom/url/tests/test_url.html index 0882e01834f2..85f39e54b9f9 100644 --- a/dom/url/tests/test_url.html +++ b/dom/url/tests/test_url.html @@ -193,7 +193,6 @@ base: undefined, error: false, protocol: "gopher:", - expectedChangedProtocol: "https:", }, { url: "ws://ws.something.net", base: undefined, @@ -209,7 +208,6 @@ base: undefined, error: false, protocol: "foo:", - expectedChangedProtocol: "https:", }, { url: "about:blank", @@ -321,8 +319,7 @@ if ("href" in test) is(url.href, test.href, "href"); if ("origin" in test) is(url.origin, test.origin, "origin"); - if ("expectedChangedProtocol" in test) is(url.protocol, test.expectedChangedProtocol, "protocol"); - else if ("protocol" in test) is(url.protocol, test.protocol, "protocol"); + if ("protocol" in test) is(url.protocol, test.protocol, "protocol"); if ("username" in test) is(url.username, test.username, "username"); if ("password" in test) is(url.password, test.password, "password"); if ("host" in test) is(url.host, test.host, "host"); diff --git a/dom/url/tests/test_url_data.html b/dom/url/tests/test_url_data.html index beeb7a2d3983..a4d017936a66 100644 --- a/dom/url/tests/test_url_data.html +++ b/dom/url/tests/test_url_data.html @@ -32,12 +32,12 @@ try { } base.protocol = "http:"; -ok(true, "Protocol: http not changed (special scheme)"); -is(base.href, "chrome://text/plain,", "Base URL is correct"); +ok(true, "Protocol: http changed"); +is(base.href, "http://text/plain,", "Base URL is correct"); relative = new URL("a", base); ok(relative, "This works."); -is(relative.href, "chrome://text/a", "Relative URL is correct"); +is(relative.href, "http://text/a", "Relative URL is correct"); diff --git a/dom/url/tests/urlApi_worker.js b/dom/url/tests/urlApi_worker.js index 5a969c8e4cae..40243c1e6686 100644 --- a/dom/url/tests/urlApi_worker.js +++ b/dom/url/tests/urlApi_worker.js @@ -202,7 +202,6 @@ onmessage = function () { base: undefined, error: false, protocol: "gopher:", - expectedChangedProtocol: "https:", }, { url: "ws://ws.something.net", @@ -221,7 +220,6 @@ onmessage = function () { base: undefined, error: false, protocol: "foo:", - expectedChangedProtocol: "https:", }, ]; @@ -319,9 +317,7 @@ onmessage = function () { if ("origin" in test) { is(url.origin, test.origin, "origin"); } - if ("expectedChangedProtocol" in test) { - is(url.protocol, test.expectedChangedProtocol, "protocol"); - } else if ("protocol" in test) { + if ("protocol" in test) { is(url.protocol, test.protocol, "protocol"); } if ("username" in test) { diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp index 2244f90e9f41..f932e64e8001 100644 --- a/netwerk/base/nsNetUtil.cpp +++ b/netwerk/base/nsNetUtil.cpp @@ -3363,102 +3363,6 @@ bool SchemeIsFTP(nsIURI* aURI) { return aURI->SchemeIs("ftp"); } -bool SchemeIsSpecial(const nsACString& aScheme) { - // See https://url.spec.whatwg.org/#special-scheme - return aScheme.EqualsIgnoreCase("ftp") || aScheme.EqualsIgnoreCase("file") || - aScheme.EqualsIgnoreCase("http") || - aScheme.EqualsIgnoreCase("https") || aScheme.EqualsIgnoreCase("ws") || - aScheme.EqualsIgnoreCase("wss"); -} - -bool IsSchemeChangePermitted(nsIURI* aOldURI, const nsACString& newScheme) { - // See step 2.1 in https://url.spec.whatwg.org/#special-scheme - // Note: The spec text uses "buffer" instead of newScheme, and "url" - MOZ_ASSERT(aOldURI); - - nsAutoCString tmp; - nsresult rv = aOldURI->GetScheme(tmp); - // If url's scheme is a special scheme and buffer is not a - // special scheme, then return. - // If url's scheme is not a special scheme and buffer is a - // special scheme, then return. - if (NS_FAILED(rv) || SchemeIsSpecial(tmp) != SchemeIsSpecial(newScheme)) { - return false; - } - - // If url's scheme is "file" and its host is an empty host, then return. - if (aOldURI->SchemeIs("file")) { - rv = aOldURI->GetHost(tmp); - if (NS_FAILED(rv) || tmp.IsEmpty()) { - return false; - } - } - - // URL Spec: If url includes credentials or has a non-null port, and - // buffer is "file", then return. - if (newScheme.EqualsIgnoreCase("file")) { - rv = aOldURI->GetUsername(tmp); - if (NS_FAILED(rv) || !tmp.IsEmpty()) { - return false; - } - rv = aOldURI->GetPassword(tmp); - if (NS_FAILED(rv) || !tmp.IsEmpty()) { - return false; - } - int32_t port; - rv = aOldURI->GetPort(&port); - if (NS_FAILED(rv) || port != -1) { - return false; - } - } - - return true; -} - -already_AddRefed TryChangeProtocol(nsIURI* aURI, - const nsAString& aProtocol) { - MOZ_ASSERT(aURI); - - nsAString::const_iterator start; - aProtocol.BeginReading(start); - - nsAString::const_iterator end; - aProtocol.EndReading(end); - - nsAString::const_iterator iter(start); - FindCharInReadable(':', iter, end); - - // Changing the protocol of a URL, changes the "nature" of the URI - // implementation. In order to do this properly, we have to serialize the - // existing URL and reparse it in a new object. - nsCOMPtr clone; - nsresult rv = NS_MutateURI(aURI) - .SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter))) - .Finalize(clone); - if (NS_WARN_IF(NS_FAILED(rv))) { - return nullptr; - } - - nsAutoCString newScheme; - rv = clone->GetScheme(newScheme); - if (NS_FAILED(rv) || !net::IsSchemeChangePermitted(aURI, newScheme)) { - return nullptr; - } - - nsAutoCString href; - rv = clone->GetSpec(href); - if (NS_WARN_IF(NS_FAILED(rv))) { - return nullptr; - } - - RefPtr uri; - rv = NS_NewURI(getter_AddRefs(uri), href); - if (NS_WARN_IF(NS_FAILED(rv))) { - return nullptr; - } - return uri.forget(); -} - // Decode a parameter value using the encoding defined in RFC 5987 (in place) // // charset "'" [ language ] "'" value-chars diff --git a/netwerk/base/nsNetUtil.h b/netwerk/base/nsNetUtil.h index 97839891105c..65a8033769d0 100644 --- a/netwerk/base/nsNetUtil.h +++ b/netwerk/base/nsNetUtil.h @@ -1016,12 +1016,6 @@ bool SchemeIsViewSource(nsIURI* aURI); bool SchemeIsResource(nsIURI* aURI); bool SchemeIsFTP(nsIURI* aURI); -// Helper functions for SetProtocol methods to follow -// step 2.1 in https://url.spec.whatwg.org/#scheme-state -bool SchemeIsSpecial(const nsACString&); -bool IsSchemeChangePermitted(nsIURI*, const nsACString&); -already_AddRefed TryChangeProtocol(nsIURI*, const nsAString&); - struct LinkHeader { nsString mHref; nsString mRel; diff --git a/testing/web-platform/meta/url/url-setters-a-area.window.js.ini b/testing/web-platform/meta/url/url-setters-a-area.window.js.ini index 6a6b66d5c52b..c1a1ce1158e8 100644 --- a/testing/web-platform/meta/url/url-setters-a-area.window.js.ini +++ b/testing/web-platform/meta/url/url-setters-a-area.window.js.ini @@ -1,4 +1,592 @@ +[url-setters-a-area.window.html] + expected: + if (os == "android") and fission: [OK, TIMEOUT] + [: Setting .protocol = 'file' Can’t switch from URL containing username/password/port to file] + expected: FAIL + + [: Setting .protocol = 'file' Can’t switch from URL containing username/password/port to file] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'http' Can’t switch from file URL with no host] + expected: FAIL + + [: Setting .protocol = 'http' Can’t switch from file URL with no host] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'wss'] + expected: FAIL + + [: Setting .protocol = 'wss'] + expected: FAIL + + [: Setting .protocol = 'b' Can’t switch from special scheme to non-special] + expected: FAIL + + [: Setting .protocol = 'b' Can’t switch from special scheme to non-special] + expected: FAIL + + [: Setting .protocol = 's'] + expected: FAIL + + [: Setting .protocol = 's'] + expected: FAIL + + [: Setting .protocol = 's'] + expected: FAIL + + [: Setting .protocol = 's'] + expected: FAIL + + [: Setting .protocol = 'test'] + expected: FAIL + + [: Setting .protocol = 'test'] + expected: FAIL + + [: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL + + [: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL + + [: Setting .protocol = 'http' Can’t switch from non-special scheme to special] + expected: FAIL + + [: Setting .protocol = 'http' Can’t switch from non-special scheme to special] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the userinfo encode set.] + expected: FAIL + + [: Setting .username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the userinfo encode set.] + expected: FAIL + + [: Setting .username = 'wario'] + expected: FAIL + + [: Setting .username = 'wario'] + expected: FAIL + + [: Setting .username = 'test'] + expected: FAIL + + [: Setting .username = 'test'] + expected: FAIL + + [: Setting .password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the userinfo encode set.] + expected: FAIL + + [: Setting .password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the userinfo encode set.] + expected: FAIL + + [: Setting .password = 'bowser'] + expected: FAIL + + [: Setting .password = 'bowser'] + expected: FAIL + + [: Setting .password = 'test'] + expected: FAIL + + [: Setting .password = 'test'] + expected: FAIL + + [: Setting .host = '\x00' Non-special scheme] + expected: FAIL + + [: Setting .host = '\x00' Non-special scheme] + expected: FAIL + + [: Setting .host = '\t'] + expected: FAIL + + [: Setting .host = '\t'] + expected: FAIL + + [: Setting .host = '\n'] + expected: FAIL + + [: Setting .host = '\n'] + expected: FAIL + + [: Setting .host = '\r'] + expected: FAIL + + [: Setting .host = '\r'] + expected: FAIL + + [: Setting .host = ' '] + expected: FAIL + + [: Setting .host = ' '] + expected: FAIL + + [: Setting .host = '#'] + expected: FAIL + + [: Setting .host = '#'] + expected: FAIL + + [: Setting .host = '/'] + expected: FAIL + + [: Setting .host = '/'] + expected: FAIL + + [: Setting .host = '?'] + expected: FAIL + + [: Setting .host = '?'] + expected: FAIL + + [: Setting .host = '@'] + expected: FAIL + + [: Setting .host = '@'] + expected: FAIL + + [: Setting .host = 'ß'] + expected: FAIL + + [: Setting .host = 'ß'] + expected: FAIL + + [: Setting .host = '' The empty host is OK for non-special schemes] + expected: FAIL + + [: Setting .host = '' The empty host is OK for non-special schemes] + expected: FAIL + + [: Setting .host = 'example.net' Path-only URLs can gain a host] + expected: FAIL + + [: Setting .host = 'example.net' Path-only URLs can gain a host] + expected: FAIL + + [: Setting .host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, but still forbidden in hosts] + expected: FAIL + + [: Setting .host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, but still forbidden in hosts] + expected: FAIL + + [: Setting .host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error] + expected: FAIL + + [: Setting .host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error] + expected: FAIL + + [: Setting .host = 'x:123'] + expected: FAIL + + [: Setting .host = 'x:123'] + expected: FAIL + + [: Setting .host = ''] + expected: FAIL + + [: Setting .host = ''] + expected: FAIL + + [: Setting .host = ''] + expected: FAIL + + [: Setting .host = ''] + expected: FAIL + + [: Setting .hostname = '\x00' Non-special scheme] + expected: FAIL + + [: Setting .hostname = '\x00' Non-special scheme] + expected: FAIL + + [: Setting .hostname = '\t'] + expected: FAIL + + [: Setting .hostname = '\t'] + expected: FAIL + + [: Setting .hostname = '\n'] + expected: FAIL + + [: Setting .hostname = '\n'] + expected: FAIL + + [: Setting .hostname = '\r'] + expected: FAIL + + [: Setting .hostname = '\r'] + expected: FAIL + + [: Setting .hostname = ' '] + expected: FAIL + + [: Setting .hostname = ' '] + expected: FAIL + + [: Setting .hostname = '#'] + expected: FAIL + + [: Setting .hostname = '#'] + expected: FAIL + + [: Setting .hostname = '/'] + expected: FAIL + + [: Setting .hostname = '/'] + expected: FAIL + + [: Setting .hostname = '?'] + expected: FAIL + + [: Setting .hostname = '?'] + expected: FAIL + + [: Setting .hostname = '@'] + expected: FAIL + + [: Setting .hostname = '@'] + expected: FAIL + + [: Setting .hostname = '' The empty host is OK for non-special schemes] + expected: FAIL + + [: Setting .hostname = '' The empty host is OK for non-special schemes] + expected: FAIL + + [: Setting .hostname = 'example.net' Path-only URLs can gain a host] + expected: FAIL + + [: Setting .hostname = 'example.net' Path-only URLs can gain a host] + expected: FAIL + + [: Setting .hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, but still forbidden in hosts] + expected: FAIL + + [: Setting .hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, but still forbidden in hosts] + expected: FAIL + + [: Setting .hostname = 'x:123'] + expected: FAIL + + [: Setting .hostname = 'x:123'] + expected: FAIL + + [: Setting .hostname = ''] + expected: FAIL + + [: Setting .hostname = ''] + expected: FAIL + + [: Setting .hostname = ''] + expected: FAIL + + [: Setting .hostname = ''] + expected: FAIL + + [: Setting .hostname = 'h' Drop /. from path] + expected: FAIL + + [: Setting .hostname = 'h' Drop /. from path] + expected: FAIL + + [: Setting .hostname = ''] + expected: FAIL + + [: Setting .hostname = ''] + expected: FAIL + + [: Setting .port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error] + expected: FAIL + + [: Setting .port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error] + expected: FAIL + + [: Setting .port = '65536' Port numbers are 16 bit integers, overflowing is an error] + expected: FAIL + + [: Setting .port = '65536' Port numbers are 16 bit integers, overflowing is an error] + expected: FAIL + + [: Setting .port = '12'] + expected: FAIL + + [: Setting .port = '12'] + expected: FAIL + + [: Setting .port = '12'] + expected: FAIL + + [: Setting .port = '12'] + expected: FAIL + + [: Setting .port = '12'] + expected: FAIL + + [: Setting .port = '12'] + expected: FAIL + + [: Setting .pathname = '/foo' Cannot-be-a-base don’t have a path] + expected: FAIL + + [: Setting .pathname = '/foo' Cannot-be-a-base don’t have a path] + expected: FAIL + + [: Setting .pathname = '/var/log/../run/bar.socket'] + expected: FAIL + + [: Setting .pathname = '/var/log/../run/bar.socket'] + expected: FAIL + + [: Setting .pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs] + expected: FAIL + + [: Setting .pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs] + expected: FAIL + + [: Setting .pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs] + expected: FAIL + + [: Setting .pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs] + expected: FAIL + + [: Setting .pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.] + expected: FAIL + + [: Setting .pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.] + expected: FAIL + + [: Setting .pathname = '?' ? needs to be encoded, non-special scheme] + expected: FAIL + + [: Setting .pathname = '?' ? needs to be encoded, non-special scheme] + expected: FAIL + + [: Setting .pathname = '#' # needs to be encoded, non-special scheme] + expected: FAIL + + [: Setting .pathname = '#' # needs to be encoded, non-special scheme] + expected: FAIL + + [: Setting .pathname = '\\\\' File URLs and (back)slashes] + expected: FAIL + + [: Setting .pathname = '\\\\' File URLs and (back)slashes] + expected: FAIL + + [: Setting .pathname = '//\\/' File URLs and (back)slashes] + expected: FAIL + + [: Setting .pathname = '//\\/' File URLs and (back)slashes] + expected: FAIL + + [: Setting .pathname = '/.//p' Serialize /. in path] + expected: FAIL + + [: Setting .pathname = '/.//p' Serialize /. in path] + expected: FAIL + + [: Setting .pathname = '/..//p'] + expected: FAIL + + [: Setting .pathname = '/..//p'] + expected: FAIL + + [: Setting .pathname = '//p'] + expected: FAIL + + [: Setting .pathname = '//p'] + expected: FAIL + + [: Setting .pathname = 'p' Drop /. from path] + expected: FAIL + + [: Setting .pathname = 'p' Drop /. from path] + expected: FAIL + + [: Setting .search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.] + expected: FAIL + + [: Setting .search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.] + expected: FAIL + + [: Setting .hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' Simple percent-encoding; tabs and newlines are removed] + expected: FAIL + + [: Setting .hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' Simple percent-encoding; tabs and newlines are removed] + expected: FAIL + + [: Setting .host = '///bad.com' Leading / is not stripped] + expected: FAIL + + [: Setting .host = '///bad.com' Leading / is not stripped] + expected: FAIL + + [: Setting .hostname = '///bad.com' Leading / is not stripped] + expected: FAIL + + [: Setting .hostname = '///bad.com' Leading / is not stripped] + expected: FAIL + + [: Setting .pathname = '' Non-special URLs can have their paths erased] + expected: FAIL + + [: Setting .pathname = '' Non-special URLs can have their paths erased] + expected: FAIL + + [: Setting .pathname = '' Non-special URLs with an empty host can have their paths erased] + expected: FAIL + + [: Setting .pathname = '' Non-special URLs with an empty host can have their paths erased] + expected: FAIL + + [: Setting .pathname = '' Path-only URLs cannot have their paths erased] + expected: FAIL + + [: Setting .pathname = '' Path-only URLs cannot have their paths erased] + expected: FAIL + + [: Setting .pathname = 'test' Path-only URLs always have an initial slash] + expected: FAIL + + [: Setting .pathname = 'test' Path-only URLs always have an initial slash] + expected: FAIL + + [: Setting .pathname = '/foo' Opaque paths cannot be set] + expected: FAIL + + [: Setting .pathname = '/foo' Opaque paths cannot be set] + expected: FAIL + + [: Setting .pathname = 'new value'] + expected: FAIL + + [: Setting .pathname = 'new value'] + expected: FAIL + + [: Setting .pathname = 'new value'] + expected: FAIL + + [: Setting .pathname = 'new value'] + expected: FAIL + + [: Setting .pathname = 'space ' Non-special URLs with non-opaque paths percent-encode U+0020] + expected: FAIL + + [: Setting .pathname = 'space ' Non-special URLs with non-opaque paths percent-encode U+0020] + expected: FAIL + + [: Setting .pathname = 'space '] + expected: FAIL + + [: Setting .pathname = 'space '] + expected: FAIL + + [: Setting .search = '' Drop trailing spaces from trailing opaque paths] + expected: FAIL + + [: Setting .search = '' Drop trailing spaces from trailing opaque paths] + expected: FAIL + + [: Setting .search = ''] + expected: FAIL + + [: Setting .search = ''] + expected: FAIL + + [: Setting .search = '' Do not drop trailing spaces from non-trailing opaque paths] + expected: FAIL + + [: Setting .search = '' Do not drop trailing spaces from non-trailing opaque paths] + expected: FAIL + + [: Setting .search = ''] + expected: FAIL + + [: Setting .search = ''] + expected: FAIL + + [: Setting .hash = '' Drop trailing spaces from trailing opaque paths] + expected: FAIL + + [: Setting .hash = '' Drop trailing spaces from trailing opaque paths] + expected: FAIL + + [: Setting .hash = ''] + expected: FAIL + + [: Setting .hash = ''] + expected: FAIL + + +[url-setters-a-area.window.html?include=mailto] + [: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL + + [: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL + + [url-setters-a-area.window.html?include=file] + [: Setting .protocol = 'http' Can’t switch from file URL with no host] + expected: FAIL + + [: Setting .protocol = 'http' Can’t switch from file URL with no host] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'wss'] + expected: FAIL + + [: Setting .protocol = 'wss'] + expected: FAIL + [: Setting .protocol = 's'] expected: FAIL @@ -49,6 +637,42 @@ [url-setters-a-area.window.html?exclude=(file|javascript|mailto)] + [: Setting .protocol = 'file' Can’t switch from URL containing username/password/port to file] + expected: FAIL + + [: Setting .protocol = 'file' Can’t switch from URL containing username/password/port to file] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'file'] + expected: FAIL + + [: Setting .protocol = 'b' Can’t switch from special scheme to non-special] + expected: FAIL + + [: Setting .protocol = 'b' Can’t switch from special scheme to non-special] + expected: FAIL + + [: Setting .protocol = 's'] + expected: FAIL + + [: Setting .protocol = 's'] + expected: FAIL + + [: Setting .protocol = 'test'] + expected: FAIL + + [: Setting .protocol = 'test'] + expected: FAIL + [: Setting .protocol = 'http' Can’t switch from non-special scheme to special] expected: FAIL @@ -73,6 +697,12 @@ [: Setting .protocol = 'file'] expected: FAIL + [: Setting .protocol = 'https'] + expected: FAIL + + [: Setting .protocol = 'https'] + expected: FAIL + [: Setting .username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~€Éé' UTF-8 percent encoding with the userinfo encode set.] expected: FAIL @@ -455,3 +1085,8 @@ [url-setters-a-area.window.html?include=mailto] + [: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL + + [: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL diff --git a/testing/web-platform/meta/url/url-setters.any.js.ini b/testing/web-platform/meta/url/url-setters.any.js.ini index 6eb88feeebe0..c02b99ea922e 100644 --- a/testing/web-platform/meta/url/url-setters.any.js.ini +++ b/testing/web-platform/meta/url/url-setters.any.js.ini @@ -609,6 +609,27 @@ [URL: Setting .port = '\t8080' Leading u0009 on non-special scheme] expected: FAIL + [URL: Setting .protocol = 'file' Can’t switch from URL containing username/password/port to file] + expected: FAIL + + [URL: Setting .protocol = 'file'] + expected: FAIL + + [URL: Setting .protocol = 'file'] + expected: FAIL + + [URL: Setting .protocol = 'b' Can’t switch from special scheme to non-special] + expected: FAIL + + [URL: Setting .protocol = 's'] + expected: FAIL + + [URL: Setting .protocol = 'test'] + expected: FAIL + + [URL: Setting .protocol = 'https'] + expected: FAIL + [url-setters.any.html?include=file] [URL: Setting .protocol = 's'] @@ -635,6 +656,9 @@ [URL: Setting .pathname = '//\\/' File URLs and (back)slashes] expected: FAIL + [URL: Setting .protocol = 'https'] + expected: FAIL + [url-setters.any.worker.html?include=javascript] [URL: Setting .username = 'wario'] @@ -834,6 +858,27 @@ [URL: Setting .port = '\t8080' Leading u0009 on non-special scheme] expected: FAIL + [URL: Setting .protocol = 'file' Can’t switch from URL containing username/password/port to file] + expected: FAIL + + [URL: Setting .protocol = 'file'] + expected: FAIL + + [URL: Setting .protocol = 'file'] + expected: FAIL + + [URL: Setting .protocol = 'b' Can’t switch from special scheme to non-special] + expected: FAIL + + [URL: Setting .protocol = 's'] + expected: FAIL + + [URL: Setting .protocol = 'test'] + expected: FAIL + + [URL: Setting .protocol = 'https'] + expected: FAIL + [url-setters.any.worker.html?include=file] [URL: Setting .protocol = 's'] @@ -860,7 +905,15 @@ [URL: Setting .pathname = '//\\/' File URLs and (back)slashes] expected: FAIL + [URL: Setting .protocol = 'https'] + expected: FAIL -[url-setters.any.worker.html?include=mailto] [url-setters.any.html?include=mailto] + [URL: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL + + +[url-setters.any.worker.html?include=mailto] + [URL: Setting .protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.] + expected: FAIL