5 https://bugzilla.mozilla.org/show_bug.cgi?id=930450
9 <title>Test for Bug
930450</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=930450">Mozilla Bug
930450</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">
26 var url = new URL(
"http://www.example.com:8080");
27 is(url.port,
"8080",
"URL.port is 8080");
29 is(url.port,
"",
"URL.port is ''");
31 is(url.port,
"0",
"URL.port is 0");
33 var link = document.getElementById(
"link");
34 is(link.port,
"8080",
"URL.port is 8080");
36 is(link.href,
"http://www.example.com/",
"link.href matches");
37 is(link.port,
"",
"URL.port is ''");
39 is(link.href,
"http://www.example.com:0/",
"link.href matches");
40 is(link.port,
"0",
"URL.port is 0");
42 var area = document.getElementById(
"area");
43 is(area.port,
"8080",
"URL.port is 8080");
45 is(area.href,
"http://www.example.com/",
"area.href matches");
46 is(area.port,
"",
"URL.port is ''");
48 is(area.href,
"http://www.example.com:0/",
"area.href matches");
49 is(area.port,
"0",
"URL.port is 0");