summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/textarea/textarea-no-scroll-on-blur.html
blob: f80ec90bdf6c594b08843eb8cd4d10e8ae85e4e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<script>
    function test() {
        if (window.testRunner)
            testRunner.dumpAsText();

        var ta = document.getElementById('ta');

        // Send caret to bottom of textarea
        ta.focus();
        ta.setSelectionRange(ta.value.length, ta.value.length);
        ta.blur();

        ta.focus();
        ta.blur();
        if (ta.scrollTop != 0)
            document.getElementById('res').innerHTML = "Test Passed";
    }
</script>
</head>
<body onload="test()">
This tests that we don't scroll back to the top when leaving a textarea
<br>
<textarea id="ta">
1
2
3
4
5
</textarea>
<div id="res">Test Failed</div>
</body>
</html>