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 <script src="../../resources/js-test.js"></script> | 4 <script src="../../resources/js-test.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <p id="description"></p> | 7 <p id="description"></p> |
8 <div id="console"></div> | 8 <div id="console"></div> |
9 <script> | 9 <script> |
10 description("This test checks the form attribute of the form-associated elements
."); | 10 description("This test checks the form attribute of the form-associated elements
."); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 owner = document.getElementById('owner'); | 171 owner = document.getElementById('owner'); |
172 shouldBeEqualToString('owner.name', 'secondOwner'); | 172 shouldBeEqualToString('owner.name', 'secondOwner'); |
173 shouldBe('inputElement.form', 'owner'); | 173 shouldBe('inputElement.form', 'owner'); |
174 shouldBe('labelElement.form', 'owner'); | 174 shouldBe('labelElement.form', 'owner'); |
175 container.removeChild(owner); | 175 container.removeChild(owner); |
176 shouldBe('inputElement.form', 'null'); | 176 shouldBe('inputElement.form', 'null'); |
177 shouldBe('labelElement.form', 'null'); | 177 shouldBe('labelElement.form', 'null'); |
178 container.appendChild(owner); | 178 container.appendChild(owner); |
179 shouldBe('inputElement.form', 'owner'); | 179 shouldBe('inputElement.form', 'owner'); |
180 shouldBe('labelElement.form', 'owner'); | 180 shouldBe('labelElement.form', 'owner'); |
| 181 |
| 182 debug(''); |
| 183 debug('- Checks if option.form is only set if it has a <select> parent.'); |
| 184 container.innerHTML = '<form id=firstOwner><option id=firstOption></option></for
m>' + |
| 185 '<form id=secondOwner><optgroup><option id=secondOption></option></optgroup>
</form>' + |
| 186 '<form id=thirdOwner><select><optgroup><option id=thirdOption></option></opt
group></select></form>'; |
| 187 var option1 = document.getElementById('firstOption'); |
| 188 shouldBe('option1.form', 'null'); |
| 189 var option2 = document.getElementById('secondOption'); |
| 190 shouldBe('option2.form', 'null'); |
| 191 owner = document.getElementById('thirdOwner'); |
| 192 var option3 = document.getElementById('thirdOption'); |
| 193 shouldBe('option3.form', 'owner'); |
181 </script> | 194 </script> |
182 </body> | 195 </body> |
183 </html> | 196 </html> |
OLD | NEW |