4 https://bugzilla.mozilla.org/show_bug.cgi?id=662170
7 <title>Test for Bug
662170</title>
8 <script type=
"application/javascript" src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <script type=
"text/javascript" src=
"/tests/SimpleTest/WindowSnapshot.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
13 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=662170">Mozilla Bug
662170</a>
15 <script type=
"application/javascript;version=1.7">
17 /** Test for Bug
662170 **/
18 SimpleTest.waitForExplicitFinish();
20 function childLoad() {
21 // Spin the event loop so we leave the onload handler.
22 SimpleTest.executeSoon(childLoad2);
25 function childLoad2() {
26 let cw = $('iframe').contentWindow;
28 // When we initially load the page, we should be at the top.
29 is(cw.pageYOffset,
0, 'Initial Y offset should be
0.');
31 // Scroll the iframe to the bottom.
34 // Did we actually scroll somewhere?
35 isnot(cw.pageYOffset,
0, 'Y offset should be non-zero after scrolling.');
37 // Now load file_bug662170.html#, which should take us to the top of the
39 cw.location = cw.location + '#';
41 is(cw.pageYOffset,
0, 'Correct Y offset after loading #.');
47 <!-- When the iframe loads, it calls childLoad(). -->
48 <iframe height='
100px' id='iframe' src='file_bug662170.html'
></iframe>