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 tests the behavior of properties collection on adding or removing itemsc
ope attribute.</p> | |
9 <div id="console"></div> | |
10 <script> | |
11 var element = createElement('div', {}, '<div itemprop="foo">bar</div>'); | |
12 | |
13 debug("<br>The properties collection must be empty if the element does not have
an itemscope attribute."); | |
14 shouldBeTrue("element.properties.length == '0'"); | |
15 shouldBeTrue("element.properties[0] == undefined"); | |
16 shouldBeTrue("element.properties.item(0) == undefined"); | |
17 | |
18 debug("<br>The properties collection must become populated if we add itemscope a
ttribute."); | |
19 element.itemScope = true; | |
20 shouldBeTrue("element.properties.length == '1'"); | |
21 shouldBeTrue("element.properties[0] == element.firstChild"); | |
22 shouldBeTrue("element.properties.item(0) == element.firstChild"); | |
23 | |
24 debug("<br>The properties collection must become empty if we remove itemscope at
tribute."); | |
25 element.itemScope = false; | |
26 shouldBeTrue("element.properties.length == '0'"); | |
27 shouldBeTrue("element.properties[0] == undefined"); | |
28 shouldBeTrue("element.properties.item(0) == undefined"); | |
29 | |
30 </script> | |
31 <script src="../../js/resources/js-test-post.js"></script> | |
32 </body> | |
33 </html> | |
OLD | NEW |