Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / select-clientheight-with-multiple-attr.html
blob6b432e235085fa84a81df4298ff482e4df47e228
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <p>HTMLSelectElement multiple attribute test when no size is specified</p>
7 <div id="console"></div>
9 <select multiple id="sel1" >
10 <option value="1">One</option>
11 </select>
13 <select multiple id="sel2" >
14 <option value="1">One</option>
15 <option value="2">Two</option>
16 <option value="3">Three</option>
17 <option value="4">Four</option>
18 <option value="5">Five</option>
19 <option value="6">Six</option>
20 <option value="7">Seven</option>
21 <option value="8">Eight</option>
22 <option value="9">Nine</option>
23 <option value="10">Ten</option>
24 <option value="11">Eleven</option>
25 <option value="12">Twelve</option>
26 <option value="13">Thirteen</option>
27 <option value="14">Fourteen</option>
28 </select>
30 <select multiple id="sel3" >
31 <option value="1">One</option>
32 <option value="2">Two</option>
33 <option value="3">Three</option>
34 </select>
36 <script>
38 function getElemById(elemId) {
39 return document.getElementById(elemId);
42 function clientHeight(elemId) {
43 var element = getElemById(elemId);
44 return element.clientHeight;
47 shouldBe("clientHeight('sel2')", "clientHeight('sel1')");
48 shouldBeTrue("getElemById('sel2').setAttribute('size', '5'); clientHeight('sel2') > clientHeight('sel1')");
49 shouldBe("clientHeight('sel3')", "clientHeight('sel1')");
50 shouldBeTrue("getElemById('sel3').setAttribute('size', '2'); clientHeight('sel3') < clientHeight('sel1')");
51 shouldBe("getElemById('sel3').setAttribute('size', '0'); clientHeight('sel3')", "clientHeight('sel1')");
52 shouldBe("getElemById('sel3').setAttribute('size', ''); clientHeight('sel3')", "clientHeight('sel1')");
53 // '1+ef' is recognized as 1. This is compatible with IE and Firefox.
54 shouldBeTrue("getElemById('sel3').setAttribute('size', '1+ef'); clientHeight('sel3') < clientHeight('sel1')");
55 </script>
56 </body>
57 </html>