Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / ValidityState-valueMissing-003.html
blob8db2df133ec7bc09d05d0a4c3605ddeacb34178b
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <title>required and valueMissing on disabled elements</title>
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <input id="input" name="victim" disabled required />
11 <textarea id="textarea" name="victim" disabled required></textarea>
12 <select id="select-no-option" name="victim" disabled required>
13 </select>
14 <select id="select-placeholder-selected" name="victim" disabled required>
15 <option value="" selected />
16 <option value="X">X</option>
17 </select>
18 <select id="select-without-placeholder" name="victim" disabled required>
19 <option value="X">X</option>
20 <option value="" selected />
21 </select>
22 <select id="select-placeholder-selected-size2" name="victim" size="2" disabled required>
23 <option value="" selected />
24 <option value="X">X</option>
25 </select>
26 <select id="select-without-placeholder-size2" name="victim" size="2" disabled required>
27 <option value="X">X</option>
28 <option value="" selected />
29 </select>
30 <select id="select-none-selected-multiple" name="victim" multiple disabled required>
31 <option value="" />
32 <option value="X">X</option>
33 </select>
34 <select id="select-fake-placeholder-selected-multiple" name="victim" multiple disabled required>
35 <option value="" selected />
36 <option value="X">X</option>
37 </select>
38 <select id="select-without-fake-placeholder-multiple" name="victim" multiple disabled required>
39 <option value="X">X</option>
40 <option value="" selected />
41 </select>
42 <select id="select-none-selected-size2-multiple" name="victim" multiple size="2" disabled required>
43 <option value="" />
44 <option value="X">X</option>
45 </select>
46 <select id="select-fake-placeholder-selected-size2-multiple" name="victim" multiple size="2" disabled required>
47 <option value="" selected />
48 <option value="X">X</option>
49 </select>
50 <select id="select-without-fake-placeholder-size2-multiple" name="victim" multiple size="2" disabled required>
51 <option value="X">X</option>
52 <option value="" selected />
53 </select>
54 <script language="JavaScript" type="text/javascript">
55 function valueMissingFor(id) {
56 return document.getElementById(id).validity.valueMissing;
59 description("This test checks validity.valueMissing of disabled form controls with blank values, blank options selected, or nothing selected.");
61 v = document.getElementsByName("victim");
63 shouldBeFalse('valueMissingFor("input")');
64 shouldBeFalse('valueMissingFor("textarea")');
65 shouldBeFalse('valueMissingFor("select-no-option")');
66 shouldBeFalse('valueMissingFor("select-placeholder-selected")');
67 shouldBeFalse('valueMissingFor("select-without-placeholder")');
68 shouldBeFalse('valueMissingFor("select-placeholder-selected-size2")');
69 shouldBeFalse('valueMissingFor("select-without-placeholder-size2")');
70 shouldBeFalse('valueMissingFor("select-none-selected-multiple")');
71 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-multiple")');
72 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-multiple")');
73 shouldBeFalse('valueMissingFor("select-none-selected-size2-multiple")');
74 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-size2-multiple")');
75 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-size2-multiple")');
76 </script>
77 </body>
78 </html>