layout/base/tests/test_bug842853-2.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/tests/test_bug842853-2.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=842853
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 842853</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 842853 **/
    1.17 +
    1.18 +SimpleTest.waitForExplicitFinish();
    1.19 +
    1.20 +function verifyAfterLoad() {
    1.21 +  var e = document.getElementsByTagName('iframe')[0];
    1.22 +  var win = e.contentWindow;
    1.23 +  if (win.location.hash != '') {
    1.24 +    is(win.scrollY,500);
    1.25 +    SimpleTest.finish();
    1.26 +    return;
    1.27 +  }
    1.28 +}
    1.29 +
    1.30 +function runTest() {
    1.31 +  var e = document.getElementsByTagName('iframe')[0];
    1.32 +  var win = e.contentWindow;
    1.33 +  if (win.location.hash != '') {
    1.34 +    return;
    1.35 +  }
    1.36 +  win.location.hash='#anchor'
    1.37 +  win.scrollTo(0,500);
    1.38 +  e.setAttribute("onload","verifyAfterLoad()");
    1.39 +  win.location.reload()
    1.40 +}
    1.41 +
    1.42 +
    1.43 +  </script>
    1.44 +</head>
    1.45 +<body>
    1.46 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=842853">Mozilla Bug 842853</a>
    1.47 +<p id="display"></p>
    1.48 +<div id="content" style="display: none">
    1.49 +</div>
    1.50 +<pre id="test">
    1.51 +</pre>
    1.52 +<iframe src="file_bug842853.html"></iframe>
    1.53 +<script>
    1.54 +
    1.55 +</script>
    1.56 +</body>
    1.57 +</html>

mercurial