| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <body> | 2 <body> |
| 3 <script src="../../../resources/js-test.js"></script> | 3 <script src="../../../resources/js-test.js"></script> |
| 4 | 4 |
| 5 <div id="parent"></div> | 5 <div id="parent"></div> |
| 6 | 6 |
| 7 <script> | 7 <script> |
| 8 description('Various tests about radio button group.'); | 8 description('Various tests about radio button group.'); |
| 9 | 9 |
| 10 const Checked = true; | 10 const Checked = true; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 shouldBeTrue('$("radio1-1").checked'); | 95 shouldBeTrue('$("radio1-1").checked'); |
| 96 shouldBeFalse('$("radio1-2").checked'); | 96 shouldBeFalse('$("radio1-2").checked'); |
| 97 shouldBeTrue('$("radio1-3").checked'); | 97 shouldBeTrue('$("radio1-3").checked'); |
| 98 | 98 |
| 99 debug('Removing a non-ancestor owner form:'); | 99 debug('Removing a non-ancestor owner form:'); |
| 100 $('form2').appendChild(createRadio('name1', Checked, 'radio1-4')); | 100 $('form2').appendChild(createRadio('name1', Checked, 'radio1-4')); |
| 101 shouldBeTrue('$("radio1-3").checked'); | 101 shouldBeTrue('$("radio1-3").checked'); |
| 102 // If there is no elements with ID specified by form= attribute, the form | 102 // If there is no elements with ID specified by form= attribute, the form |
| 103 // control is not associated to any forms. | 103 // control is not associated to any forms. |
| 104 parent.removeChild($('form1')); | 104 parent.removeChild($('form1')); |
| 105 // FIXME: We need to call gc() twice on Apple Mac. | |
| 106 gc(); | |
| 107 gc(); | 105 gc(); |
| 108 shouldBeTrue('$("radio1-4").checked'); | 106 shouldBeTrue('$("radio1-4").checked'); |
| 109 debug('(The following test depends on gc(). It might fail on a real browser.)'); | 107 debug('(The following test depends on gc(). It might fail on a real browser.)'); |
| 110 shouldBeFalse('$("radio1-1").checked'); | 108 shouldBeFalse('$("radio1-1").checked'); |
| 111 shouldBeTrue('$("radio1-3").checked'); | 109 shouldBeTrue('$("radio1-3").checked'); |
| 112 | 110 |
| 113 debug(''); | 111 debug(''); |
| 114 debug('Adding a radio button to an orphan tree:'); | 112 debug('Adding a radio button to an orphan tree:'); |
| 115 var orphanDiv = document.createElement('div'); | 113 var orphanDiv = document.createElement('div'); |
| 116 orphanDiv.appendChild(createRadio('name2', Checked, '')); | 114 orphanDiv.appendChild(createRadio('name2', Checked, '')); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 146 parent.appendChild(original); | 144 parent.appendChild(original); |
| 147 var clonedRadio = original.cloneNode(true); | 145 var clonedRadio = original.cloneNode(true); |
| 148 shouldBeTrue('original.checked'); | 146 shouldBeTrue('original.checked'); |
| 149 shouldBeTrue('clonedRadio.checked'); | 147 shouldBeTrue('clonedRadio.checked'); |
| 150 | 148 |
| 151 parent.innerHTML = ''; | 149 parent.innerHTML = ''; |
| 152 debug(''); | 150 debug(''); |
| 153 </script> | 151 </script> |
| 154 | 152 |
| 155 </body> | 153 </body> |
| OLD | NEW |