| OLD | NEW |
| 1 description("This test performs a check that :valid/:invalid CSS psudo selectors
are lively applied."); | 1 description("This test performs a check that :valid/:invalid CSS psudo selectors
are lively applied."); |
| 2 | 2 |
| 3 // Setup for static elements. | 3 // Setup for static elements. |
| 4 var form = document.createElement('form'); | 4 var form = document.createElement('form'); |
| 5 document.body.appendChild(form); | 5 document.body.appendChild(form); |
| 6 var nonForm = document.createElement('div'); | 6 var nonForm = document.createElement('div'); |
| 7 document.body.appendChild(nonForm); | 7 document.body.appendChild(nonForm); |
| 8 | 8 |
| 9 function mouseDownOnSelect(selId, index, modifier) { | 9 function mouseDownOnSelect(selId, index, modifier) { |
| 10 var sl = document.getElementById(selId); | 10 var sl = document.getElementById(selId); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 ' <option id="multiple-empty">empty</option>' + | 109 ' <option id="multiple-empty">empty</option>' + |
| 110 ' <option id="multiple-another">another</option>' + | 110 ' <option id="multiple-another">another</option>' + |
| 111 '</select>' + | 111 '</select>' + |
| 112 '<select id="select-size4" size="4" required>' + | 112 '<select id="select-size4" size="4" required>' + |
| 113 ' <option id="size4-empty">empty</option>' + | 113 ' <option id="size4-empty">empty</option>' + |
| 114 ' <option id="size4-another">another</option>' + | 114 ' <option id="size4-another">another</option>' + |
| 115 '</select>'; | 115 '</select>'; |
| 116 mouseDownOnSelect('select-multiple', 0); | 116 mouseDownOnSelect('select-multiple', 0); |
| 117 mouseDownOnSelect('select-size4', 0); | 117 mouseDownOnSelect('select-size4', 0); |
| 118 shouldBe('backgroundOf("select-multiple")', 'validColor'); | 118 shouldBe('backgroundOf("select-multiple")', 'validColor'); |
| 119 shouldBe('backgroundOf("multiple-empty")', 'transparentColor'); | |
| 120 shouldBe('backgroundOf("select-size4")', 'validColor'); | 119 shouldBe('backgroundOf("select-size4")', 'validColor'); |
| 121 shouldBe('backgroundOf("size4-empty")', 'transparentColor'); | |
| 122 | 120 |
| 123 debug('Change the value with a placeholder label option:'); | 121 debug('Change the value with a placeholder label option:'); |
| 124 el = makeInvalid(); | 122 el = makeInvalid(); |
| 125 o1 = appendOption('', el); | 123 o1 = appendOption('', el); |
| 126 o2 = appendOption('X', el); | 124 o2 = appendOption('X', el); |
| 127 o2.selected = true; | 125 o2.selected = true; |
| 128 shouldBe(elBackground, 'validColor'); | 126 shouldBe(elBackground, 'validColor'); |
| 129 o1.selected = true; | 127 o1.selected = true; |
| 130 shouldBe(elBackground, 'invalidColor'); | 128 shouldBe(elBackground, 'invalidColor'); |
| 131 | 129 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // -------------------------------- | 203 // -------------------------------- |
| 206 debug('Change required:'); | 204 debug('Change required:'); |
| 207 el = makeInvalid(); | 205 el = makeInvalid(); |
| 208 o1 = appendOption('', el); | 206 o1 = appendOption('', el); |
| 209 o2 = appendOption('X', el); | 207 o2 = appendOption('X', el); |
| 210 o1.selected = true; | 208 o1.selected = true; |
| 211 el.required = false; | 209 el.required = false; |
| 212 shouldBe(elBackground, 'validColor'); | 210 shouldBe(elBackground, 'validColor'); |
| 213 el.required = true; | 211 el.required = true; |
| 214 shouldBe(elBackground, 'invalidColor'); | 212 shouldBe(elBackground, 'invalidColor'); |
| OLD | NEW |