Merge mozilla-central to autoland on a CLOSED TREE

This commit is contained in:
Iulian Moraru 2023-01-24 01:34:59 +02:00
commit 551e2e66d9
6 changed files with 138 additions and 1219 deletions

View File

@ -326,16 +326,13 @@ NS_IMETHODIMP nsIDNService::IsACE(const nsACString& input, bool* _retval) {
auto stringContains = [](const nsACString& haystack,
const nsACString& needle) {
return std::search(haystack.BeginReading(), haystack.EndReading(),
needle.BeginReading(), needle.EndReading(),
[](unsigned char ch1, unsigned char ch2) {
return tolower(ch1) == tolower(ch2);
}) != haystack.EndReading();
needle.BeginReading(),
needle.EndReading()) != haystack.EndReading();
};
*_retval =
StringBeginsWith(input, "xn--"_ns, nsCaseInsensitiveCStringComparator) ||
(!input.IsEmpty() && input[0] != '.' &&
stringContains(input, ".xn--"_ns));
*_retval = StringBeginsWith(input, "xn--"_ns) ||
(!input.IsEmpty() && input[0] != '.' &&
stringContains(input, ".xn--"_ns));
return NS_OK;
}
@ -542,7 +539,7 @@ nsresult nsIDNService::stringPrepAndACE(const nsAString& in, nsACString& out,
if (IsAscii(in)) {
LossyCopyUTF16toASCII(in, out);
// If label begins with xn-- we still want to check its validity
if (!StringBeginsWith(in, u"xn--"_ns, nsCaseInsensitiveStringComparator)) {
if (!StringBeginsWith(in, u"xn--"_ns)) {
return NS_OK;
}
}

View File

@ -1040,8 +1040,4 @@ add_task(function test_jarURI_serialization() {
add_task(async function round_trip_invalid_ace_label() {
let uri = Services.io.newURI("http://xn--xn--d--fg4n-5y45d/");
Assert.equal(uri.spec, "http://xn--xn--d--fg4n-5y45d/");
Assert.throws(() => {
uri = Services.io.newURI("http://a.b.c.XN--pokxncvks");
}, /NS_ERROR_MALFORMED_URI/);
});

View File

@ -1097,6 +1097,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL

View File

@ -1126,6 +1126,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL

File diff suppressed because it is too large Load Diff

View File

@ -1257,6 +1257,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL
@ -2001,6 +2033,38 @@
[Parsing: <http://www.@pple.com> against <about:blank>]
expected: FAIL
[Parsing: <http://a.b.c.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://a.b.c.Xn--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.XN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <http://10.0.0.xN--pokxncvks> against <about:blank>]
expected:
if not debug and (os == "linux") and fission: [FAIL, PASS]
if not debug and (os == "linux") and not fission: [FAIL, PASS]
if not debug and (os == "android"): [FAIL, PASS]
if not debug and (os == "mac"): [FAIL, PASS]
FAIL
[Parsing: <sc://faß.ExAmPlE/> against <about:blank>]
expected: FAIL