4 <script src="../../js/resources/js-test-pre.js"></script>
5 <script src="resources/microdata-common.js"></script>
8 <p>This test ensures that live NodeList must notice when itemscope attribute changes.</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>
13 var one = document.getElementById('one');
14 var two = document.getElementById('two');
16 runTest(document.getItems(), [one, two], "This test page contain two microdata items");
18 // Remove itemscope attribute
19 one.removeAttribute('itemscope');
20 runTest(document.getItems(), [two], "Removing itemscope attribute should reflect in the NodeList");
22 // Setting itemscope attribute
23 one.setAttribute('itemscope','itemscope');
24 runTest(document.getItems(), [one, two], "Set itemscope attribute should reflect in the NodeList");
26 // Setting itemscope attribute to false
27 two.itemScope = false;
28 runTest(document.getItems(), [one], "Set element.itemScope to false should notice in the NodeList");
30 // Setting itemscope attribute to true
32 runTest(document.getItems(), [one, two], "Set element.itemScope to true should notice in the NodeList");
35 <script src="../../js/resources/js-test-post.js"></script>