test_bug842853-2.html (1349B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=842853 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 842853</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 11 <script type="application/javascript"> 12 13 /** Test for Bug 842853 */ 14 15 SimpleTest.waitForExplicitFinish(); 16 17 async function verifyAfterLoad() { 18 var e = document.getElementsByTagName('iframe')[0]; 19 var win = e.contentWindow; 20 if (win.location.hash != '') { 21 // Allow a half pixel difference because the scroll position is aligned with 22 // screen pixels instead of CSS pixels (bug 1774315). 23 isfuzzy(win.scrollY, 500, 0.5); 24 SimpleTest.finish(); 25 return; 26 } 27 } 28 29 function runTest() { 30 var e = document.getElementsByTagName('iframe')[0]; 31 var win = e.contentWindow; 32 if (win.location.hash != '') { 33 return; 34 } 35 win.location.hash='#anchor' 36 win.scrollTo(0,500); 37 e.setAttribute("onload","verifyAfterLoad()"); 38 win.location.reload() 39 } 40 41 42 </script> 43 </head> 44 <body> 45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=842853">Mozilla Bug 842853</a> 46 <p id="display"></p> 47 <div id="content" style="display: none"> 48 </div> 49 <pre id="test"> 50 </pre> 51 <iframe src="file_bug842853.html"></iframe> 52 <script> 53 54 </script> 55 </body> 56 </html>