1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/forms/test/test_bug562447.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,62 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=562447 1.8 +--> 1.9 +<head> 1.10 + <title>Test for Bug 562447</title> 1.11 + <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> 1.12 + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 1.13 + 1.14 +</head> 1.15 +<body> 1.16 +<p><a target="_blank" href="https://bugzilla.mozilla.org/show_bug?id=562447">Mozilla Bug 562447</a> 1.17 + 1.18 +<input id="WhyDoYouFocusMe" 1.19 + style="position: absolute; left: -50px; top: 10000px;"> 1.20 + 1.21 +<pre id="test"> 1.22 +<script> 1.23 +addLoadEvent(function() { 1.24 + // Scroll down a bit 1.25 + window.scrollTo(0, 5000); 1.26 + 1.27 + setTimeout(function() { 1.28 + // Make sure that we're scrolled by 5000px 1.29 + is(window.pageYOffset, 5000, "Make sure we're scrolled correctly"); 1.30 + 1.31 + // Scroll back up, and mess with the input box along the way 1.32 + var input = document.getElementById("WhyDoYouFocusMe"); 1.33 + input.focus(); 1.34 + input.blur(); 1.35 + window.scrollTo(0, 0); 1.36 + 1.37 + setTimeout(function() { 1.38 + is(window.pageYOffset, 0, "Make sure we're scrolled back up correctly"); 1.39 + 1.40 + // Scroll back up 1.41 + window.scrollTo(0, 5000); 1.42 + 1.43 + setTimeout(function() { 1.44 + is(window.pageYOffset, 5000, "Sanity check"); 1.45 + 1.46 + window.scrollTo(0, 0); 1.47 + input.focus(); 1.48 + input.blur(); 1.49 + 1.50 + setTimeout(function() { 1.51 + isnot(window.pageYOffset, 0, "This time we shouldn't be scrolled up"); 1.52 + 1.53 + SimpleTest.finish(); 1.54 + }, 0); 1.55 + }, 0); 1.56 + }, 0); 1.57 + }, 0); 1.58 +}); 1.59 + 1.60 +SimpleTest.waitForExplicitFinish(); 1.61 +</script> 1.62 +</pre> 1.63 + 1.64 +</body> 1.65 +</html>