1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/base/tests/test_bug849219.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=849219 1.8 +--> 1.9 +<head> 1.10 + <meta charset="utf-8"> 1.11 + <title>Test for Bug 849219</title> 1.12 + <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.13 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.14 + <script type="application/javascript"> 1.15 + 1.16 + /** Test for Bug 849219 **/ 1.17 + 1.18 +SimpleTest.waitForExplicitFinish(); 1.19 + 1.20 +function runTest() { 1.21 + var win = e.contentWindow; 1.22 + if (win.location.hash != '') { 1.23 + is(win.scrollY,0); 1.24 + SimpleTest.finish(); 1.25 + return; 1.26 + } 1.27 + win.location.hash='#anchor' 1.28 + win.scrollTo(0,0); 1.29 + win.location.reload() 1.30 +} 1.31 + 1.32 + 1.33 + </script> 1.34 +</head> 1.35 +<body> 1.36 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=849219">Mozilla Bug 849219</a> 1.37 +<p id="display"></p> 1.38 +<div id="content" style="display: none"> 1.39 + 1.40 +</div> 1.41 +<pre id="test"> 1.42 +</pre> 1.43 +<script> 1.44 + 1.45 +var e = document.createElement('iframe'); 1.46 +var url = 'data:text/html,<a href="%23anchor">Click to scroll to anchor</a><div style="height:5000px"></div><a name="anchor">FAIL</a>' 1.47 +e.setAttribute('src',url); 1.48 +e.setAttribute('onload','runTest()'); 1.49 +document.body.appendChild(e); 1.50 + 1.51 +</script> 1.52 +</body> 1.53 +</html>