|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=849219 |
|
5 --> |
|
6 <head> |
|
7 <meta charset="utf-8"> |
|
8 <title>Test for Bug 849219</title> |
|
9 <script type="application/javascript" 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 849219 **/ |
|
14 |
|
15 SimpleTest.waitForExplicitFinish(); |
|
16 |
|
17 function runTest() { |
|
18 var win = e.contentWindow; |
|
19 if (win.location.hash != '') { |
|
20 is(win.scrollY,0); |
|
21 SimpleTest.finish(); |
|
22 return; |
|
23 } |
|
24 win.location.hash='#anchor' |
|
25 win.scrollTo(0,0); |
|
26 win.location.reload() |
|
27 } |
|
28 |
|
29 |
|
30 </script> |
|
31 </head> |
|
32 <body> |
|
33 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=849219">Mozilla Bug 849219</a> |
|
34 <p id="display"></p> |
|
35 <div id="content" style="display: none"> |
|
36 |
|
37 </div> |
|
38 <pre id="test"> |
|
39 </pre> |
|
40 <script> |
|
41 |
|
42 var e = document.createElement('iframe'); |
|
43 var url = 'data:text/html,<a href="%23anchor">Click to scroll to anchor</a><div style="height:5000px"></div><a name="anchor">FAIL</a>' |
|
44 e.setAttribute('src',url); |
|
45 e.setAttribute('onload','runTest()'); |
|
46 document.body.appendChild(e); |
|
47 |
|
48 </script> |
|
49 </body> |
|
50 </html> |