| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 debug('Change the values of select elements without explicit initializing values
by clicking:'); | 108 debug('Change the values of select elements without explicit initializing values
by clicking:'); |
| 109 form.innerHTML = '<select id="select-multiple" multiple required size="4">' + | 109 form.innerHTML = '<select id="select-multiple" multiple required size="4">' + |
| 110 ' <option id="multiple-empty">empty</option>' + | 110 ' <option id="multiple-empty">empty</option>' + |
| 111 ' <option id="multiple-another">another</option>' + | 111 ' <option id="multiple-another">another</option>' + |
| 112 '</select>' + | 112 '</select>' + |
| 113 '<select id="select-size4" size="4" required>' + | 113 '<select id="select-size4" size="4" required>' + |
| 114 ' <option id="size4-empty">empty</option>' + | 114 ' <option id="size4-empty">empty</option>' + |
| 115 ' <option id="size4-another">another</option>' + | 115 ' <option id="size4-another">another</option>' + |
| 116 '</select>'; | 116 '</select>'; |
| 117 mouseDownOnSelect('select-multiple', 0); | 117 mouseDownOnSelect('select-multiple', 1); |
| 118 mouseDownOnSelect('select-size4', 0); | 118 mouseDownOnSelect('select-size4', 1); |
| 119 shouldBe('backgroundOf("select-multiple")', 'validColor'); | 119 shouldBe('backgroundOf("select-multiple")', 'validColor'); |
| 120 shouldBe('backgroundOf("multiple-empty")', 'transparentColor'); | 120 shouldBe('backgroundOf("multiple-empty")', 'transparentColor'); |
| 121 shouldBe('backgroundOf("select-size4")', 'validColor'); | 121 shouldBe('backgroundOf("select-size4")', 'validColor'); |
| 122 shouldBe('backgroundOf("size4-empty")', 'transparentColor'); | 122 shouldBe('backgroundOf("size4-empty")', 'transparentColor'); |
| 123 | 123 |
| 124 debug('Change the value with a placeholder label option:'); | 124 debug('Change the value with a placeholder label option:'); |
| 125 el = makeInvalid(); | 125 el = makeInvalid(); |
| 126 o1 = appendOption('', el); | 126 o1 = appendOption('', el); |
| 127 o2 = appendOption('X', el); | 127 o2 = appendOption('X', el); |
| 128 o2.selected = true; | 128 o2.selected = true; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // -------------------------------- | 206 // -------------------------------- |
| 207 debug('Change required:'); | 207 debug('Change required:'); |
| 208 el = makeInvalid(); | 208 el = makeInvalid(); |
| 209 o1 = appendOption('', el); | 209 o1 = appendOption('', el); |
| 210 o2 = appendOption('X', el); | 210 o2 = appendOption('X', el); |
| 211 o1.selected = true; | 211 o1.selected = true; |
| 212 el.required = false; | 212 el.required = false; |
| 213 shouldBe(elBackground, 'validColor'); | 213 shouldBe(elBackground, 'validColor'); |
| 214 el.required = true; | 214 el.required = true; |
| 215 shouldBe(elBackground, 'invalidColor'); | 215 shouldBe(elBackground, 'invalidColor'); |
| OLD | NEW |