| 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>This test ensures that live NodeList must notice when itemscope attribute cha
nges.</p> | |
| 9 <div itemscope itemtype="http://example.com/foo" id="one"></div> | |
| 10 <div itemscope itemtype="http://example.com/bar" id="two"></div> | |
| 11 <div id="console"></div> | |
| 12 <script> | |
| 13 var one = document.getElementById('one'); | |
| 14 var two = document.getElementById('two'); | |
| 15 | |
| 16 runTest(document.getItems(), [one, two], "This test page contain two microdata i
tems"); | |
| 17 | |
| 18 // Remove itemscope attribute | |
| 19 one.removeAttribute('itemscope'); | |
| 20 runTest(document.getItems(), [two], "Removing itemscope attribute should reflect
in the NodeList"); | |
| 21 | |
| 22 // Setting itemscope attribute | |
| 23 one.setAttribute('itemscope','itemscope'); | |
| 24 runTest(document.getItems(), [one, two], "Set itemscope attribute should reflect
in the NodeList"); | |
| 25 | |
| 26 // Setting itemscope attribute to false | |
| 27 two.itemScope = false; | |
| 28 runTest(document.getItems(), [one], "Set element.itemScope to false should notic
e in the NodeList"); | |
| 29 | |
| 30 // Setting itemscope attribute to true | |
| 31 two.itemScope = true; | |
| 32 runTest(document.getItems(), [one, two], "Set element.itemScope to true should n
otice in the NodeList"); | |
| 33 | |
| 34 </script> | |
| 35 <script src="../../js/resources/js-test-post.js"></script> | |
| 36 </body> | |
| 37 </html> | |
| OLD | NEW |