| OLD | NEW |
| 1 <script src="../../../resources/js-test.js"></script> | 1 <script src="../../../resources/js-test.js"></script> |
| 2 <fieldset id="fs1" name="a"></fieldset> | 2 <fieldset id="fs1" name="a"></fieldset> |
| 3 <script> | 3 <script> |
| 4 description("This test checks fieldset.name attribute."); | 4 description("This test checks fieldset.name attribute."); |
| 5 debug("Read from HTML"); | 5 debug("Read from HTML"); |
| 6 shouldBe('fs1.name', '"a"'); | 6 shouldBe('fs1.name', '"a"'); |
| 7 shouldBe('fs1.getAttribute("name")', '"a"'); | 7 shouldBe('fs1.getAttribute("name")', '"a"'); |
| 8 | 8 |
| 9 debug('fs1.name="b"'); | 9 debug('fs1.name="b"'); |
| 10 fs1.name = "b"; | 10 fs1.name = "b"; |
| 11 shouldBe('fs1.name', '"b"'); | 11 shouldBe('fs1.name', '"b"'); |
| 12 shouldBe('fs1.getAttribute("name")', '"b"'); | 12 shouldBe('fs1.getAttribute("name")', '"b"'); |
| 13 | 13 |
| 14 debug('fs1.name=1234'); | 14 debug('fs1.name=1234'); |
| 15 fs1.name = 1234; | 15 fs1.name = 1234; |
| 16 shouldBe('fs1.name', '"1234"'); | 16 shouldBe('fs1.name', '"1234"'); |
| 17 shouldBe('fs1.getAttribute("name")', '"1234"'); | 17 shouldBe('fs1.getAttribute("name")', '"1234"'); |
| 18 | 18 |
| 19 // FIXME: The specification doesn't have clear description for setting null to n
ame. | |
| 20 // We may need to update below once the specification fixed. | |
| 21 debug('fs1.name=null'); | 19 debug('fs1.name=null'); |
| 22 fs1.name = null; | 20 fs1.name = null; |
| 23 shouldBe('fs1.name', '""'); | 21 shouldBe('fs1.name', '"null"'); |
| 24 shouldBeNull('fs1.getAttribute("name")'); | 22 shouldBe('fs1.getAttribute("name")', '"null"'); |
| 25 shouldBeFalse('fs1.hasAttribute("name")'); | 23 shouldBeTrue('fs1.hasAttribute("name")'); |
| 26 | 24 |
| 27 debug('fs1.name=undefined'); | 25 debug('fs1.name=undefined'); |
| 28 fs1.name = undefined; | 26 fs1.name = undefined; |
| 29 shouldBe('fs1.name', '"undefined"'); | 27 shouldBe('fs1.name', '"undefined"'); |
| 30 shouldBe('fs1.getAttribute("name")', '"undefined"'); | 28 shouldBe('fs1.getAttribute("name")', '"undefined"'); |
| 31 shouldBeTrue('fs1.hasAttribute("name")'); | 29 shouldBeTrue('fs1.hasAttribute("name")'); |
| 32 </script> | 30 </script> |
| 33 | 31 |
| OLD | NEW |