OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>required and basic valueMissing</title> | 4 <title>required and basic valueMissing</title> |
5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 <input id="input" name="victim" required/> | 10 <input id="input" name="victim" required/> |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 <select id="select-optgroup" name="victim" required> | 54 <select id="select-optgroup" name="victim" required> |
55 <optgroup label="1"> | 55 <optgroup label="1"> |
56 <option value="" selected /> | 56 <option value="" selected /> |
57 </optgroup> | 57 </optgroup> |
58 <option value="X">X</option> | 58 <option value="X">X</option> |
59 </select> | 59 </select> |
60 <select id="select-disabled-option" name="victim" required> | 60 <select id="select-disabled-option" name="victim" required> |
61 <option value="" disabled selected /> | 61 <option value="" disabled selected /> |
62 <option value="X">X</option> | 62 <option value="X">X</option> |
63 </select> | 63 </select> |
| 64 <select id="select-disabled-option-2" name="victim" required> |
| 65 <option value="" disabled /> |
| 66 <option value="X">X</option> |
| 67 </select> |
64 <script language="JavaScript" type="text/javascript"> | 68 <script language="JavaScript" type="text/javascript"> |
65 function valueMissingFor(id) { | 69 function valueMissingFor(id) { |
66 return document.getElementById(id).validity.valueMissing; | 70 return document.getElementById(id).validity.valueMissing; |
67 } | 71 } |
68 | 72 |
69 description("This test checks validity.valueMissing with blank values, blank
options selected, or nothing selected."); | 73 description("This test checks validity.valueMissing with blank values, blank
options selected, or nothing selected."); |
70 | 74 |
71 v = document.getElementsByName("victim"); | 75 v = document.getElementsByName("victim"); |
72 | 76 |
73 shouldBeTrue('valueMissingFor("input")'); | 77 shouldBeTrue('valueMissingFor("input")'); |
74 shouldBeTrue('valueMissingFor("textarea")'); | 78 shouldBeTrue('valueMissingFor("textarea")'); |
75 shouldBeTrue('valueMissingFor("select-no-option")'); | 79 shouldBeTrue('valueMissingFor("select-no-option")'); |
76 shouldBeTrue('valueMissingFor("select-placeholder-selected")'); | 80 shouldBeTrue('valueMissingFor("select-placeholder-selected")'); |
77 shouldBeFalse('valueMissingFor("select-without-placeholder")'); | 81 shouldBeFalse('valueMissingFor("select-without-placeholder")'); |
78 shouldBeFalse('valueMissingFor("select-placeholder-selected-size2")'); | 82 shouldBeFalse('valueMissingFor("select-placeholder-selected-size2")'); |
79 shouldBeFalse('valueMissingFor("select-without-placeholder-size2")'); | 83 shouldBeFalse('valueMissingFor("select-without-placeholder-size2")'); |
80 shouldBeTrue('valueMissingFor("select-none-selected-multiple")'); | 84 shouldBeTrue('valueMissingFor("select-none-selected-multiple")'); |
81 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-multiple")'
); | 85 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-multiple")'
); |
82 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-multiple")')
; | 86 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-multiple")')
; |
83 shouldBeTrue('valueMissingFor("select-none-selected-size2-multiple")'); | 87 shouldBeTrue('valueMissingFor("select-none-selected-size2-multiple")'); |
84 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-size2-multi
ple")'); | 88 shouldBeFalse('valueMissingFor("select-fake-placeholder-selected-size2-multi
ple")'); |
85 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-size2-multip
le")'); | 89 shouldBeFalse('valueMissingFor("select-without-fake-placeholder-size2-multip
le")'); |
86 shouldBeFalse('valueMissingFor("select-optgroup")'); | 90 shouldBeFalse('valueMissingFor("select-optgroup")'); |
87 shouldBeTrue('valueMissingFor("select-disabled-option")'); | 91 shouldBeTrue('valueMissingFor("select-disabled-option")'); |
| 92 shouldBeFalse('valueMissingFor("select-disabled-option-2")'); |
| 93 shouldBe('document.getElementById("select-disabled-option-2").selectedIndex'
, '1'); |
88 </script> | 94 </script> |
89 </body> | 95 </body> |
90 </html> | 96 </html> |
OLD | NEW |