layout/base/tests/test_bug66619.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=66619
     5 -->
     6 <head>
     7   <title>Test for Bug 66619</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    10 </head>
    11 <body onload="run()">
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=66619">Mozilla Bug 66619</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script class="testbody" type="text/javascript">
    20 /** Test for Bug 66619 **/
    22 SimpleTest.waitForExplicitFinish();
    24 function run()
    25 {
    26   is(window.scrollY, 0, "window should initially be at top");
    28   document.getElementById("first").focus();
    29   var first = window.scrollY;
    30   isnot(first, 0, "we scrolled to first anchor");
    31   ok(first + window.innerHeight > 4000,
    32      "we scrolled enough to show the anchor");
    34   window.scrollTo(0, 0);
    35   document.getElementById("second").focus();
    36   var second = window.scrollY;
    38   window.scrollTo(0, 0);
    39   document.getElementById("third").focus();
    40   var third = window.scrollY;
    42   is(second, first, "we scrolled the second line of the anchor into view");
    43   isnot(third, second, "we scrolled the second line of the anchor into view");
    44   ok(third > second, "we scrolled the second line of the anchor into view");
    46   window.scrollTo(0, 0); // make the results visible
    47   SimpleTest.finish();
    48 }
    51 </script>
    52 </pre>
    54 <div style="height:4000px"></div>
    55 <a id="first"  href="http://www.mozilla.org/">first<br>link</a>
    56 <a id="second" href="http://www.mozilla.org/">second link</a>
    57 <a id="third"  href="http://www.mozilla.org/">third<br>link</a>
    58 <div style="height:4000px"></div>
    60 </body>
    61 </html>

mercurial