|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=132255 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 132255</title> |
|
8 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
|
10 <base href="http://mochi.test:8888/tests/dom/tests/mochitest/"> |
|
11 </head> |
|
12 <body> |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=132255">Mozilla Bug 132255</a> |
|
14 <p id="display"> |
|
15 <iframe src="javascript:'<a href=\'foo.html\'>test-anchor</a>'"></iframe> |
|
16 <iframe src="javascript:'<base href=\'http://example.com/\'><a href=\'foo.html\'>test-anchor</a>'"></iframe> |
|
17 </p> |
|
18 <div id="content" style="display: none"> |
|
19 |
|
20 </div> |
|
21 <pre id="test"> |
|
22 <script type="application/javascript"> |
|
23 |
|
24 /** Test for Bug 132255 **/ |
|
25 SimpleTest.waitForExplicitFinish(); |
|
26 addLoadEvent(function() { |
|
27 is(window.frames[0].document.links[0].href, |
|
28 window.location.href.replace(/bugs\/test_bug132255\.html/, "foo.html"), |
|
29 "Unexpected anchor href"); |
|
30 is(window.frames[1].document.links[0].href, |
|
31 "http://example.com/foo.html", |
|
32 "Unexpected anchor href when base set"); |
|
33 }) |
|
34 addLoadEvent(SimpleTest.finish); |
|
35 </script> |
|
36 </pre> |
|
37 </body> |
|
38 </html> |