Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=562447 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 562447</title> |
michael@0 | 8 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> |
michael@0 | 10 | |
michael@0 | 11 | </head> |
michael@0 | 12 | <body> |
michael@0 | 13 | <p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug?id=562447">Mozilla Bug 562447</a> |
michael@0 | 14 | |
michael@0 | 15 | <input id="WhyDoYouFocusMe" |
michael@0 | 16 | style="position: absolute; left: -50px; top: 10000px;"> |
michael@0 | 17 | |
michael@0 | 18 | <pre id="test"> |
michael@0 | 19 | <script> |
michael@0 | 20 | addLoadEvent(function() { |
michael@0 | 21 | // Scroll down a bit |
michael@0 | 22 | window.scrollTo(0, 5000); |
michael@0 | 23 | |
michael@0 | 24 | setTimeout(function() { |
michael@0 | 25 | // Make sure that we're scrolled by 5000px |
michael@0 | 26 | is(window.pageYOffset, 5000, "Make sure we're scrolled correctly"); |
michael@0 | 27 | |
michael@0 | 28 | // Scroll back up, and mess with the input box along the way |
michael@0 | 29 | var input = document.getElementById("WhyDoYouFocusMe"); |
michael@0 | 30 | input.focus(); |
michael@0 | 31 | input.blur(); |
michael@0 | 32 | window.scrollTo(0, 0); |
michael@0 | 33 | |
michael@0 | 34 | setTimeout(function() { |
michael@0 | 35 | is(window.pageYOffset, 0, "Make sure we're scrolled back up correctly"); |
michael@0 | 36 | |
michael@0 | 37 | // Scroll back up |
michael@0 | 38 | window.scrollTo(0, 5000); |
michael@0 | 39 | |
michael@0 | 40 | setTimeout(function() { |
michael@0 | 41 | is(window.pageYOffset, 5000, "Sanity check"); |
michael@0 | 42 | |
michael@0 | 43 | window.scrollTo(0, 0); |
michael@0 | 44 | input.focus(); |
michael@0 | 45 | input.blur(); |
michael@0 | 46 | |
michael@0 | 47 | setTimeout(function() { |
michael@0 | 48 | isnot(window.pageYOffset, 0, "This time we shouldn't be scrolled up"); |
michael@0 | 49 | |
michael@0 | 50 | SimpleTest.finish(); |
michael@0 | 51 | }, 0); |
michael@0 | 52 | }, 0); |
michael@0 | 53 | }, 0); |
michael@0 | 54 | }, 0); |
michael@0 | 55 | }); |
michael@0 | 56 | |
michael@0 | 57 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 58 | </script> |
michael@0 | 59 | </pre> |
michael@0 | 60 | |
michael@0 | 61 | </body> |
michael@0 | 62 | </html> |