summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/select/select-width-font-change.html
blob: a021d50bb34e0749ffd6fde3559462145659363a (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
<head>

<script>

function test()
{
    if (window.testRunner)
        testRunner.dumpAsText();

    var widthBefore = document.getElementById("select").offsetWidth;
    document.getElementById("select").setAttribute("style", "font-size: 32px");
    var widthAfter = document.getElementById("select").offsetWidth;

    if (widthAfter - widthBefore > 20)
        document.getElementById("result").innerHTML = "PASS: Resize seems to have worked.";
    else
        document.getElementById("result").innerHTML = "FAIL: Size is not enough bigger after the style change.";
}

</script>

</head>

<body onload="test()">

<p>This test checks to see if changing the font of a select element causes it to resize to accomodate the larger text.</p>

<p><select id="select" style="font-size: 9px">
<option>This is an option with some text in it.</option>
</select></p>

<p id="result"></p>

<body>