layout/forms/test/test_bug231389.html

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

mercurial