| OLD | NEW |
| (Empty) |
| 1 description('Various tests for the the hidden IDL attribute.'); | |
| 2 | |
| 3 var testParent = document.createElement('div'); | |
| 4 document.body.appendChild(testParent); | |
| 5 | |
| 6 debug('The IDL attribute reflects what is present in markup:'); | |
| 7 testParent.innerHTML = '<div id=h1 hidden></div><div id=h2 hidden=false></div><d
iv id=h3 hidden=off></div><div id=s1></div>'; | |
| 8 var h1 = document.getElementById("h1"); | |
| 9 var h2 = document.getElementById("h2"); | |
| 10 var h3 = document.getElementById("h3"); | |
| 11 var s1 = document.getElementById("s1"); | |
| 12 | |
| 13 shouldBeTrue('h1.hidden'); | |
| 14 shouldBeTrue('h2.hidden'); | |
| 15 shouldBeTrue('h3.hidden'); | |
| 16 shouldBeFalse('s1.hidden'); | |
| 17 | |
| 18 debug('Changes via DOM Core are reflected through the IDL attribute:'); | |
| 19 | |
| 20 shouldBeFalse('(h1.removeAttribute("hidden"), h1.hidden)'); | |
| 21 shouldBeTrue('(h1.setAttribute("hidden", ""), h1.hidden)'); | |
| 22 shouldBeTrue('(h2.setAttribute("hidden", ""), h2.hidden)'); | |
| 23 shouldBeTrue('(s1.setAttribute("hidden", ""), s1.hidden)'); | |
| 24 | |
| 25 debug('Changes via IDL attribute are reflected in the core DOM:'); | |
| 26 | |
| 27 shouldBe('(h3.hidden = false, h3.getAttribute("hidden"))', 'null'); | |
| 28 shouldBe('(h3.hidden = true, h3.getAttribute("hidden"))', '""'); | |
| OLD | NEW |