layout/forms/test/test_bug572649.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/forms/test/test_bug572649.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=572649
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 572649</title>
    1.11 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    1.13 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.14 +</head>
    1.15 +<body>
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=572649">Mozilla Bug 572649</a>
    1.17 +<p id="display">
    1.18 +  <textarea id="area" rows="5">
    1.19 +  Here
    1.20 +  is
    1.21 +  some
    1.22 +  very
    1.23 +  long
    1.24 +  text
    1.25 +  that
    1.26 +  we're
    1.27 +  using
    1.28 +  for
    1.29 +  testing
    1.30 +  purposes
    1.31 +  </textarea>
    1.32 +</p>
    1.33 +<div id="content" style="display: none">
    1.34 +  
    1.35 +</div>
    1.36 +<pre id="test">
    1.37 +<script type="application/javascript">
    1.38 +
    1.39 +/** Test for Bug 572649 **/
    1.40 +SimpleTest.waitForExplicitFinish();
    1.41 +addLoadEvent(function() {
    1.42 +  var area = document.getElementById("area");
    1.43 +
    1.44 +  is(area.scrollTop, 0, "The textarea should not be scrolled initially");
    1.45 +  area.addEventListener("focus", function() {
    1.46 +    area.removeEventListener("focus", arguments.callee, false);
    1.47 +    setTimeout(function() {
    1.48 +      is(area.scrollTop, 0, "The textarea's insertion point should not be scrolled into view");
    1.49 +
    1.50 +      SimpleTest.finish();
    1.51 +    }, 0);
    1.52 +  }, false);
    1.53 +  setTimeout(function() {
    1.54 +    var rect = area.getBoundingClientRect();
    1.55 +    synthesizeMouse(area, rect.width - 5, 5, {});
    1.56 +  }, 0);
    1.57 +});
    1.58 +
    1.59 +</script>
    1.60 +</pre>
    1.61 +</body>
    1.62 +</html>

mercurial