|
1 <!DOCTYPE html> |
|
2 <html> |
|
3 <head> |
|
4 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
5 <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script> |
|
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
7 <script type="text/javascript" src="NavigationUtils.js"></script> |
|
8 <style type="text/css"> |
|
9 iframe { width: 90%; height: 50px; } |
|
10 </style> |
|
11 <script> |
|
12 window.onload = function () { |
|
13 document.getElementById('active').innerHTML = |
|
14 '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#parent.frames[0],location"></iframe>' + |
|
15 '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#child1,open"></iframe>' + |
|
16 '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#child2,form"></iframe>' + |
|
17 '<iframe src="http://test1.example.org:80/tests/docshell/test/navigation/navigate.html#child3,hyperlink"></iframe>'; |
|
18 |
|
19 xpcWaitForFinishedFrames(function() { |
|
20 isBlank(frames[0], "Should not be able to navigate off-domain sibling by setting location."); |
|
21 isBlank(frames[1], "Should not be able to navigate off-domain sibling by calling window.open."); |
|
22 isBlank(frames[2], "Should not be able to navigate off-domain sibling by submitting form."); |
|
23 isBlank(frames[3], "Should not be able to navigate off-domain sibling by targeted hyperlink."); |
|
24 |
|
25 xpcCleanupWindows(); |
|
26 SimpleTest.finish(); |
|
27 }, 4); |
|
28 } |
|
29 </script> |
|
30 </head> |
|
31 <body> |
|
32 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a> |
|
33 <div id="frames"> |
|
34 <iframe name="child0" src="blank.html"></iframe> |
|
35 <iframe name="child1" src="blank.html"></iframe> |
|
36 <iframe name="child2" src="blank.html"></iframe> |
|
37 <iframe name="child3" src="blank.html"></iframe> |
|
38 </div> |
|
39 <div id="active"></div> |
|
40 <pre id="test"> |
|
41 <script type="text/javascript"> |
|
42 SimpleTest.waitForExplicitFinish(); |
|
43 </script> |
|
44 </pre> |
|
45 </body> |
|
46 </html> |