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 <script> | |
9 description("Test to ensure that adding or removing itemprop tokens must update
its PropertyNodeList."); | |
10 var item = createElement('div', {itemscope: 'itemscope'}, '<div itemprop="foo"><
/div><div></div>'); | |
11 var PNLfoo = item.properties.namedItem('foo'); | |
12 PNLbar = item.properties.namedItem('bar'); | |
13 | |
14 shouldBe("PNLfoo.length", "1"); | |
15 shouldBe("PNLbar.length", "0"); | |
16 shouldBe("PNLfoo[0]", "item.firstChild"); | |
17 | |
18 item.lastChild.itemProp.toggle('bar'); | |
19 shouldBe("PNLfoo.length", "1"); | |
20 shouldBe("PNLbar.length", "1"); | |
21 shouldBe("PNLfoo[0]", "item.firstChild"); | |
22 shouldBe("PNLbar[0]", "item.lastChild"); | |
23 | |
24 item.lastChild.itemProp.add('foo'); | |
25 shouldBe("PNLfoo.length", "2"); | |
26 shouldBe("PNLbar.length", "1"); | |
27 shouldBe("PNLfoo[0]", "item.firstChild"); | |
28 shouldBe("PNLfoo[1]", "item.lastChild"); | |
29 shouldBe("PNLbar[0]", "item.lastChild"); | |
30 | |
31 item.lastChild.removeAttribute('itemprop'); | |
32 shouldBe("PNLfoo.length", "1"); | |
33 shouldBe("PNLbar.length", "0"); | |
34 shouldBe("PNLfoo[0]", "item.firstChild"); | |
35 </script> | |
36 <script src="../../js/resources/js-test-post.js"></script> | |
37 </body> | |
38 </html> | |
OLD | NEW |