Backed out changeset 189b914221f4 (bug 1324243) for wpt-11 bustage

This commit is contained in:
Carsten "Tomcat" Book 2017-03-06 14:13:03 +01:00
parent 0cb0b2702b
commit a25648d3cd
14 changed files with 62 additions and 50 deletions

View File

@ -200,13 +200,11 @@ var testcases = [ {
protocolChange: true,
}, {
input: "[64:ff9b::8.8.8.8]",
fixedURI: "http://[64:ff9b::808:808]/",
alternateURI: "http://[64:ff9b::808:808]/",
fixedURI: "http://[64:ff9b::8.8.8.8]/",
protocolChange: true
}, {
input: "[64:ff9b::8.8.8.8]/~moz",
fixedURI: "http://[64:ff9b::808:808]/~moz",
alternateURI: "http://[64:ff9b::808:808]/~moz",
fixedURI: "http://[64:ff9b::8.8.8.8]/~moz",
protocolChange: true
}, {
input: "[::1][::1]",

View File

@ -323,8 +323,8 @@
is(url.href, "http://[2001::1]/");
url.hostname = "[::192.9.5.5]";
is(url.hostname, "[::c009:505]", "IPv6 hostname");
is(url.href, "http://[::c009:505]/");
is(url.hostname, "[::192.9.5.5]", "IPv6 hostname");
is(url.href, "http://[::192.9.5.5]/");
url = new URL("http://localhost/");
url.hostname = "[::]";

View File

@ -773,14 +773,7 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
if (!SegmentIs(spec, mScheme, "resource") &&
!SegmentIs(spec, mScheme, "chrome")) {
nsAutoCString ipString;
if (encHost.Length() > 0 &&
encHost.First() == '[' && encHost.Last() == ']') {
rv = (nsresult) rusturl_parse_ipv6addr(&encHost, &ipString);
if (NS_FAILED(rv)) {
return rv;
}
encHost = ipString;
} else if (NS_SUCCEEDED(NormalizeIPv4(encHost, ipString))) {
if (NS_SUCCEEDED(NormalizeIPv4(encHost, ipString))) {
encHost = ipString;
}
}
@ -2021,14 +2014,7 @@ nsStandardURL::SetHost(const nsACString &input)
if (!SegmentIs(mScheme, "resource") && !SegmentIs(mScheme, "chrome")) {
nsAutoCString ipString;
if (hostBuf.Length() > 0 &&
hostBuf.First() == '[' && hostBuf.Last() == ']') {
rv = (nsresult) rusturl_parse_ipv6addr(&hostBuf, &ipString);
if (NS_FAILED(rv)) {
return rv;
}
hostBuf = ipString;
} else if (NS_SUCCEEDED(NormalizeIPv4(hostBuf, ipString))) {
if (NS_SUCCEEDED(NormalizeIPv4(hostBuf, ipString))) {
hostBuf = ipString;
}
}

View File

@ -525,19 +525,3 @@ pub extern "C" fn rusturl_relative_spec(urlptr1: Option<&Url>, urlptr2: Option<&
pub extern "C" fn sizeof_rusturl() -> size_t {
mem::size_of::<Url>()
}
#[no_mangle]
pub extern "C" fn rusturl_parse_ipv6addr(input: &nsACString, cont: &mut nsACString) -> i32 {
let ip6 = match str::from_utf8(input) {
Ok(content) => content,
Err(_) => return ParseError::InvalidDomainCharacter.error_code()
};
let h = match url::Host::parse(ip6) {
Ok(host) => host,
Err(e) => return e.error_code()
};
cont.assign(&h.to_string());
NSError::OK.error_code()
}

View File

@ -47,8 +47,6 @@ int32_t rusturl_resolve(const rusturl* url, const nsACString* relative, nsACStri
int32_t rusturl_common_base_spec(const rusturl* url1, const rusturl* url2, nsACString* cont);
int32_t rusturl_relative_spec(const rusturl* url1, const rusturl* url2, nsACString* cont);
int32_t rusturl_parse_ipv6addr(const nsACString* input, nsACString* cont);
size_t sizeof_rusturl();
}

View File

@ -150,8 +150,8 @@ var gTests = [
nsIURL: true, nsINestedURI: false },
{ spec: "http://[::192.9.5.5]/ipng",
scheme: "http",
prePath: "http://[::c009:505]",
host: "::c009:505",
prePath: "http://[::192.9.5.5]",
host: "::192.9.5.5",
path: "/ipng",
ref: "",
nsIURL: true, nsINestedURI: false },

View File

@ -461,11 +461,3 @@ add_test(function test_invalidHostChars() {
// hostname separators, so there is no way to set them and fail.
run_next_test();
});
add_test(function test_normalize_ipv6() {
var url = stringToURL("http://example.com");
url.host = "[::192.9.5.5]";
do_check_eq(url.spec, "http://[::c009:505]/");
run_next_test();
});

View File

@ -6,6 +6,12 @@
[Parsing origin: <http://::@c@d:2> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing origin: <http://[::127.0.0.1\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing origin: <http://[0:0:0:0:0:0:13.1.68.3\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar>]
expected: FAIL

View File

@ -6,6 +6,12 @@
[Parsing origin: <http://::@c@d:2> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing origin: <http://[::127.0.0.1\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing origin: <http://[0:0:0:0:0:0:13.1.68.3\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing origin: <gopher:/example.com/> against <http://example.org/foo/bar>]
expected: FAIL

View File

@ -414,6 +414,12 @@
[Parsing: <tel:1234567890> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <http://[::127.0.0.1\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <http://[0:0:0:0:0:0:13.1.68.3\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <https://test:@test> against <about:blank>]
expected: FAIL

View File

@ -423,6 +423,12 @@
[Parsing: <tel:1234567890> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <http://[::127.0.0.1\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <http://[0:0:0:0:0:0:13.1.68.3\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <https://test:@test> against <about:blank>]
expected: FAIL

View File

@ -201,6 +201,12 @@
[Parsing: <file:..> against <http://www.example.com/test>]
expected: FAIL
[Parsing: <http://[::127.0.0.1\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <http://[0:0:0:0:0:0:13.1.68.3\]> against <http://example.org/foo/bar>]
expected: FAIL
[Parsing: <https://test:@test> against <about:blank>]
expected: FAIL

View File

@ -6,6 +6,12 @@
[Origin parsing: <http://::@c@d:2> against <http://example.org/foo/bar>]
expected: FAIL
[Origin parsing: <http://[::127.0.0.1\]> against <http://example.org/foo/bar>]
expected: FAIL
[Origin parsing: <http://[0:0:0:0:0:0:13.1.68.3\]> against <http://example.org/foo/bar>]
expected: FAIL
[Origin parsing: <gopher:/example.com/> against <http://example.org/foo/bar>]
expected: FAIL

View File

@ -228,6 +228,15 @@
[<area>: Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
expected: FAIL
[URL: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
expected: FAIL
[<a>: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
expected: FAIL
[<area>: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
expected: FAIL
[URL: Setting <view-source+http://example.net/path>.host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and its invalid in a domain]
expected: FAIL
@ -264,6 +273,15 @@
[<area>: Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
expected: FAIL
[URL: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
expected: FAIL
[<a>: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
expected: FAIL
[<area>: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
expected: FAIL
[URL: Setting <http://example.net/path>.hostname = 'example.com:8080' Stuff after a : delimiter is ignored]
expected: FAIL