test_bug132255.html (1234B)
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 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(/\?.*/, "") 29 .replace(/bugs\/test_bug132255\.html/, "foo.html"), 30 "Unexpected anchor href"); 31 is(window.frames[1].document.links[0].href, 32 "http://example.com/foo.html", 33 "Unexpected anchor href when base set"); 34 }) 35 addLoadEvent(SimpleTest.finish); 36 </script> 37 </pre> 38 </body> 39 </html>