OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../../../js-test-resources/js-test-pre.js"></script> | 4 <script src="../../../js-test-resources/js-test-pre.js"></script> |
5 <script> | 5 <script> |
6 function runTest() { | 6 function runTest() { |
7 description('Tests that loading a cross-origin frame with a URL that conta
ins an anchor fragment does not scroll this frame.'); | 7 description('Tests that loading a cross-origin frame with a URL that conta
ins an anchor fragment does not scroll this frame.'); |
8 description('This prevents a cross-origin information leak sometimes know
as framesniffing.'); | 8 description('This prevents a cross-origin information leak sometimes know
as framesniffing.'); |
9 // Check scroll position in a timeout to make sure that the anchor has not
been scrolled to. | 9 // Check scroll position in a timeout to make sure that the anchor has not
been scrolled to. |
10 setTimeout(function() { | 10 setTimeout(function() { |
11 shouldBeTrue('document.body.scrollTop == 0'); | 11 shouldBeTrue('document.documentElement.scrollTop == 0'); |
12 shouldBeTrue('document.body.scrollLeft == 0'); | 12 shouldBeTrue('document.documentElement.scrollLeft == 0'); |
13 finishJSTest(); | 13 finishJSTest(); |
14 }, 0); | 14 }, 0); |
15 } | 15 } |
16 var jsTestIsAsync = true; | 16 var jsTestIsAsync = true; |
17 </script> | 17 </script> |
18 </head> | 18 </head> |
19 <body> | 19 <body> |
20 <!-- large cross-origin grandchild frame --> | 20 <!-- large cross-origin grandchild frame --> |
21 <iframe height="8000" width="8000" src="http://localhost:8000/navigation/resourc
es/grandchild-with-anchor.html#anchor1" name="grandchild" onload="runTest()"> | 21 <iframe height="8000" width="8000" src="http://localhost:8000/navigation/resourc
es/grandchild-with-anchor.html#anchor1" name="grandchild" onload="runTest()"> |
22 </iframe> | 22 </iframe> |
23 <script src="../../../js-test-resources/js-test-post.js"></script> | 23 <script src="../../../js-test-resources/js-test-post.js"></script> |
24 </body> | 24 </body> |
25 </html> | 25 </html> |
OLD | NEW |