OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 | 5 |
6 <div id="container"></div> | 6 <div id="container"></div> |
7 <pre id="console"></pre> | 7 <pre id="console"></pre> |
8 | 8 |
9 <script> | 9 <script> |
10 description("Tests to ensure ShadowRoot.getElementById works after complex DOM m
anipulation."); | 10 description("Tests to ensure ShadowRoot.getElementById works after complex DOM m
anipulation."); |
(...skipping 12 matching lines...) Expand all Loading... |
23 var shadowRootA = A.createShadowRoot(); | 23 var shadowRootA = A.createShadowRoot(); |
24 var shadowRootB = B.createShadowRoot(); | 24 var shadowRootB = B.createShadowRoot(); |
25 var shadowRootC = C.createShadowRoot(); | 25 var shadowRootC = C.createShadowRoot(); |
26 | 26 |
27 shadowRootA.appendChild(B); | 27 shadowRootA.appendChild(B); |
28 shadowRootB.appendChild(C); | 28 shadowRootB.appendChild(C); |
29 shadowRootC.appendChild(D); | 29 shadowRootC.appendChild(D); |
30 | 30 |
31 container.appendChild(A); | 31 container.appendChild(A); |
32 shouldBe('document.getElementById("A")', 'A'); | 32 shouldBe('document.getElementById("A")', 'A'); |
| 33 shouldThrow('shadowRootA.getElementById()'); |
33 shouldBe('shadowRootA.getElementById("B")', 'B'); | 34 shouldBe('shadowRootA.getElementById("B")', 'B'); |
34 shouldBe('shadowRootB.getElementById("C")', 'C'); | 35 shouldBe('shadowRootB.getElementById("C")', 'C'); |
35 shouldBe('shadowRootC.getElementById("D")', 'D'); | 36 shouldBe('shadowRootC.getElementById("D")', 'D'); |
36 | 37 |
37 debug(''); | 38 debug(''); |
38 debug('Remove C from shadowRootB'); | 39 debug('Remove C from shadowRootB'); |
39 shadowRootB.removeChild(C); | 40 shadowRootB.removeChild(C); |
40 | 41 |
41 shouldBe('document.getElementById("A")', 'A'); | 42 shouldBe('document.getElementById("A")', 'A'); |
42 shouldBe('shadowRootA.getElementById("B")', 'B'); | 43 shouldBe('shadowRootA.getElementById("B")', 'B'); |
(...skipping 24 matching lines...) Expand all Loading... |
67 shadowRootC.removeChild(D); | 68 shadowRootC.removeChild(D); |
68 | 69 |
69 shouldBe('document.getElementById("A")', 'null'); | 70 shouldBe('document.getElementById("A")', 'null'); |
70 shouldBe('shadowRootA.getElementById("B")', 'B'); | 71 shouldBe('shadowRootA.getElementById("B")', 'B'); |
71 shouldBe('shadowRootB.getElementById("C")', 'null'); | 72 shouldBe('shadowRootB.getElementById("C")', 'null'); |
72 shouldBe('shadowRootC.getElementById("D")', 'null'); | 73 shouldBe('shadowRootC.getElementById("D")', 'null'); |
73 | 74 |
74 </script> | 75 </script> |
75 </body> | 76 </body> |
76 </html> | 77 </html> |
OLD | NEW |