|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 While working on bug 402210, it came up that the code was doing |
|
5 |
|
6 a.href = proto + host |
|
7 |
|
8 which technically produces "https:host" instead of "https://host" and |
|
9 that the code was relying on href's setting having fixup behaviour |
|
10 for this kind of thing. |
|
11 |
|
12 If we rely on it, we might as well test for it, even if it isn't the |
|
13 problem 402210 was meant to fix. |
|
14 |
|
15 https://bugzilla.mozilla.org/show_bug.cgi?id=402210 |
|
16 --> |
|
17 <head> |
|
18 <title>Test for Bug 402210</title> |
|
19 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
20 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
21 </head> |
|
22 <body> |
|
23 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=402210">Mozilla Bug 402210</a> |
|
24 <p id="display"> |
|
25 <a id="testlink">Test Link</a> |
|
26 </p> |
|
27 <div id="content" style="display: none"> |
|
28 |
|
29 </div> |
|
30 <pre id="test"> |
|
31 <script class="testbody" type="text/javascript"> |
|
32 |
|
33 SimpleTest.waitForExplicitFinish(); |
|
34 |
|
35 function runTest() { |
|
36 $("testlink").href = "https:example.com"; |
|
37 is($("testlink").href, "https://example.com/", "Setting href on an anchor tag should fixup missing slashes after https protocol"); |
|
38 |
|
39 $("testlink").href = "ftp:example.com"; |
|
40 is($("testlink").href, "ftp://example.com/", "Setting href on an anchor tag should fixup missing slashes after non-http protocol"); |
|
41 |
|
42 SimpleTest.finish(); |
|
43 } |
|
44 |
|
45 addLoadEvent(runTest); |
|
46 </script> |
|
47 </pre> |
|
48 </body> |
|
49 </html> |
|
50 |