summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/js/text-field-resize.html
blob: 1bfb3a23867b46077b3bf0d7f4370c6f0ffe8665 (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
35
36
37
<HTML>
<HEAD>
<SCRIPT>
if (window.testRunner)
    testRunner.dumpAsText();

function log(s)
{
    document.getElementById("console").appendChild(document.createTextNode(s));
    document.getElementById("console").appendChild(document.createElement("br"));
}

function resize() {
    var input_field_width_before_resize = document.getElementById('success').clientWidth;
    document.getElementById('success').size=30;
    var input_field_width_after_resize = document.getElementById('success').clientWidth;
    if(input_field_width_after_resize > input_field_width_before_resize) {
        log("SUCCESS");
    } else {
        log("FAIL");
    }
    input_field_width_before_resize = document.getElementById('success').clientWidth;
    document.getElementById('success').setAttribute("size", 40);
    input_field_width_after_resize = document.getElementById('success').clientWidth;
    if(input_field_width_after_resize > input_field_width_before_resize) {
        log("SUCCESS");
    } else {
        log("FAIL");
    }
}
</SCRIPT>
</HEAD>
<BODY onLoad="resize();">
<span id="console"></span>
<input type="text" id="success" size="2">
</BODY>
</HTML>