| 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 181 |
| 182 debug(''); | 182 debug(''); |
| 183 debug('- Check if a form and a control are disassociated when they are removed f
rom the document together.'); |
| 184 container.innerHTML = '<div><input form=owner><form id=owner></form></div>'; |
| 185 owner = document.getElementById('owner'); |
| 186 shouldBe('owner.elements.length', '1'); |
| 187 container.firstChild.remove(); |
| 188 shouldBe('owner.elements.length', '0'); |
| 189 |
| 190 debug(''); |
| 183 debug('- Checks if option.form is only set if it has a <select> parent.'); | 191 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>' + | 192 container.innerHTML = '<form id=firstOwner><option id=firstOption></option></for
m>' + |
| 185 '<form id=secondOwner><optgroup><option id=secondOption></option></optgroup>
</form>' + | 193 '<form id=secondOwner><optgroup><option id=secondOption></option></optgroup>
</form>' + |
| 186 '<form id=thirdOwner><select><optgroup><option id=thirdOption></option></opt
group></select></form>'; | 194 '<form id=thirdOwner><select><optgroup><option id=thirdOption></option></opt
group></select></form>'; |
| 187 var option1 = document.getElementById('firstOption'); | 195 var option1 = document.getElementById('firstOption'); |
| 188 shouldBe('option1.form', 'null'); | 196 shouldBe('option1.form', 'null'); |
| 189 var option2 = document.getElementById('secondOption'); | 197 var option2 = document.getElementById('secondOption'); |
| 190 shouldBe('option2.form', 'null'); | 198 shouldBe('option2.form', 'null'); |
| 191 owner = document.getElementById('thirdOwner'); | 199 owner = document.getElementById('thirdOwner'); |
| 192 var option3 = document.getElementById('thirdOption'); | 200 var option3 = document.getElementById('thirdOption'); |
| 193 shouldBe('option3.form', 'owner'); | 201 shouldBe('option3.form', 'owner'); |
| 202 |
| 203 container.remove(); |
| 194 </script> | 204 </script> |
| 195 </body> | 205 </body> |
| 196 </html> | 206 </html> |
| OLD | NEW |