layout/forms/test/test_bug562447.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=562447
     5 -->
     6 <head>
     7   <title>Test for Bug 562447</title>
     8   <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11 </head>
    12 <body>
    13 <p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug?id=562447">Mozilla Bug 562447</a>
    15 <input id="WhyDoYouFocusMe"
    16        style="position: absolute; left: -50px; top: 10000px;">
    18 <pre id="test">
    19 <script>
    20 addLoadEvent(function() {
    21   // Scroll down a bit
    22   window.scrollTo(0, 5000);
    24   setTimeout(function() {
    25     // Make sure that we're scrolled by 5000px
    26     is(window.pageYOffset, 5000, "Make sure we're scrolled correctly");
    28     // Scroll back up, and mess with the input box along the way
    29     var input = document.getElementById("WhyDoYouFocusMe");
    30     input.focus();
    31     input.blur();
    32     window.scrollTo(0, 0);
    34     setTimeout(function() {
    35       is(window.pageYOffset, 0, "Make sure we're scrolled back up correctly");
    37       // Scroll back up
    38       window.scrollTo(0, 5000);
    40       setTimeout(function() {
    41         is(window.pageYOffset, 5000, "Sanity check");
    43         window.scrollTo(0, 0);
    44         input.focus();
    45         input.blur();
    47         setTimeout(function() {
    48           isnot(window.pageYOffset, 0, "This time we shouldn't be scrolled up");
    50           SimpleTest.finish();
    51         }, 0);
    52       }, 0);
    53     }, 0);
    54   }, 0);
    55 });
    57 SimpleTest.waitForExplicitFinish();
    58 </script>
    59 </pre>
    61 </body>
    62 </html>

mercurial