5 https://bugzilla.mozilla.org/show_bug.cgi?id=1020041
9 <title>Test for Bug
1020041</title>
10 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
11 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
14 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1020041">Mozilla Bug
1020041</a>
16 <div id=
"content" style=
"display: none">
17 <iframe name=
"x" id=
"x"></iframe>
18 <iframe name=
"y" id=
"y"></iframe>
22 <a id=
"link" href=
"http://www.example.com:8080">foobar
</a>
23 <area id=
"area" href=
"http://www.example.com:8080" />
24 <script type=
"application/javascript">
27 { host:
"?", expected:
"www.example.com" },
28 { host:
"what?", expected:
"what" },
29 { host:
"so what", expected:
"www.example.com" },
30 { host:
"aa#bb", expected:
"aa" },
31 { host:
"a/b", expected:
"a" },
32 { host:
"a\\b", expected:
"a" },
33 { host:
"[2001::1]#bla:10", expected:
"[2001::1]"},
36 for (var i =
0; i < tests.length; ++i) {
37 var url = new URL(
"http://www.example.com");
38 url.host = tests[i].host;
39 is(url.host, tests[i].expected,
"URL.host is: " + url.host);
41 url = new URL(
"http://www.example.com");
42 url.hostname = tests[i].host;
43 is(url.hostname, tests[i].expected,
"URL.hostname is: " + url.host);