OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 | 3 |
4 <pre id="console"></div> | 4 <pre id="console"></div> |
5 | 5 |
6 <script> | 6 <script> |
7 description('Tests ShadowRoot.olderShadowRoot property'); | 7 description('Tests ShadowRoot.olderShadowRoot property'); |
8 | 8 |
9 function createRoots(host, n) { | 9 function createRoots(host, n) { |
10 var roots = []; | 10 var roots = []; |
(...skipping 24 matching lines...) Expand all Loading... |
35 roots = createRoots(host, 7); | 35 roots = createRoots(host, 7); |
36 shouldBeNull('roots[0].olderShadowRoot'); | 36 shouldBeNull('roots[0].olderShadowRoot'); |
37 shouldBe('roots[1].olderShadowRoot', 'roots[0]'); | 37 shouldBe('roots[1].olderShadowRoot', 'roots[0]'); |
38 shouldBe('roots[6].olderShadowRoot', 'roots[5]'); | 38 shouldBe('roots[6].olderShadowRoot', 'roots[5]'); |
39 | 39 |
40 // Single root | 40 // Single root |
41 host = document.createElement('table'); | 41 host = document.createElement('table'); |
42 root = host.createShadowRoot(); | 42 root = host.createShadowRoot(); |
43 shouldBeNull('root.olderShadowRoot'); | 43 shouldBeNull('root.olderShadowRoot'); |
44 | 44 |
45 // Cannot access a user-agent shadow | |
46 | |
47 host = document.createElement('details'); | |
48 root = host.createShadowRoot(); | |
49 shouldBeNull('root.olderShadowRoot'); | |
50 | |
51 host = document.createElement('summary'); | |
52 document.body.appendChild(host); | |
53 root = host.createShadowRoot(); | |
54 shouldBeNull('root.olderShadowRoot'); | |
55 host.remove(); | |
56 | |
57 // Cannot set property | 45 // Cannot set property |
58 | |
59 host = document.createElement('span'); | 46 host = document.createElement('span'); |
60 roots = createRoots(host, 2); | 47 roots = createRoots(host, 2); |
61 var donor = document.createElement('div'); | 48 var donor = document.createElement('div'); |
62 donor.root = donor.createShadowRoot(); | 49 donor.root = donor.createShadowRoot(); |
63 roots[1].olderShadowRoot = donor.root; | 50 roots[1].olderShadowRoot = donor.root; |
64 shouldBe('roots[1].olderShadowRoot', 'roots[0]'); | 51 shouldBe('roots[1].olderShadowRoot', 'roots[0]'); |
65 | 52 |
66 host = document.createElement('details'); | |
67 document.body.appendChild(host); | |
68 root = host.createShadowRoot(); | |
69 donor = document.createElement('div'); | |
70 donor.root = donor.createShadowRoot(); | |
71 root.olderShadowRoot = donor.root; | |
72 shouldBeNull('root.olderShadowRoot'); | |
73 host.remove(); | |
74 | |
75 successfullyParsed = true; | 53 successfullyParsed = true; |
76 </script> | 54 </script> |
77 </body> | 55 </body> |
78 </html> | 56 </html> |
OLD | NEW |