| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | |
| 5 <script src="resources/microdata-common.js"></script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <p>Microdata properties collection should update properly on adding or removing
itemref.</p> | |
| 9 <div id="console"></div> | |
| 10 <script> | |
| 11 var element = createElement('div', {}, '<div id="id1" itemprop="foo"></div><div
itemscope></div>'); | |
| 12 var item = element.childNodes[1]; | |
| 13 document.body.appendChild(element); | |
| 14 | |
| 15 shouldBeTrue("item.properties.length == '0'"); | |
| 16 | |
| 17 debug("<br>Set itemref to id1."); | |
| 18 item.setAttribute('itemref', 'id1'); | |
| 19 shouldBeTrue("item.properties.length == '1'"); | |
| 20 shouldBeTrue("item.properties.item(0) == element.firstChild"); | |
| 21 shouldBeTrue("item.properties[0] == element.firstChild"); | |
| 22 | |
| 23 debug("<br>Remove itemref attribute."); | |
| 24 item.removeAttribute('itemref'); | |
| 25 shouldBeTrue("item.properties.length == '0'"); | |
| 26 shouldBeTrue("item.properties.item(0) == undefined"); | |
| 27 shouldBeTrue("item.properties[0] == undefined"); | |
| 28 | |
| 29 </script> | |
| 30 <script src="../../js/resources/js-test-post.js"></script> | |
| 31 </body> | |
| 32 </html> | |
| OLD | NEW |