summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/text/input-selection-hidden.html
blob: 52d065b878c2978cba55e02b35ef3d3508d11fdb (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
<html>
<head>
<script>
function log(msg) {
    document.getElementById('res').innerHTML = document.getElementById('res').innerHTML + msg + "<br>";
}
    
function test () {
    if (window.testRunner)
        testRunner.dumpAsText();

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

    tf.setSelectionRange(3, 12);
    log("setSelectionRange(3, 12)");
    if (tf.selectionStart == 3 && tf.selectionEnd == 12)
        log("Passed.");
    else
        log("Failed. selection start: " + tf.selectionStart + " selection end: " + tf.selectionEnd);
        
    tf.style.visibility = "visible";
}
</script>
</head>
<body onload="test()">
This tests the selection methods on the new text field when it is hidden and then made visible.
<p>
<input type="text" id="tf" style="visibility:hidden" value="123456789 ABCDEFGHIJ"></input>
<div id="res"></div>
</p>
</body>
</html>