OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <script src="../resources/js-test.js"></script> | |
3 <script src="../fast/dom/shadow/resources/shadow-dom.js"></script> | |
4 <body></body> | |
5 <script> | |
6 description("Tests for getDestinationInsertionPoints() which involves re-distrib
ution."); | |
7 | |
8 document.body.appendChild( | |
9 createDOM('div', {}, | |
10 createDOM('div', {'id': 'host-1'}, | |
11 createShadowRoot( | |
12 createDOM('div', {'id': 'host-2'}, | |
13 createShadowRoot( | |
14 createDOM('content', {'id': 'content-2
'})), | |
15 createDOM('content', {'id': 'content-1'}))
), | |
16 createDOM('div', {'id': 'child-1'})))); | |
17 | |
18 shouldBeEqualAsArray(document.getElementById('child-1').getDestinationInsertionP
oints(), | |
19 [getNodeInComposedTree('host-1/content-1'), getNodeInCompos
edTree('host-1/host-2/content-2')]); | |
20 | |
21 document.body.appendChild( | |
22 createDOM('div', {}, | |
23 createDOM('div', {'id': 'host-10'}, | |
24 createShadowRoot( | |
25 createDOM('div', {'id': 'host-20'}, | |
26 attachShadow( | |
27 {'mode': 'open'}, | |
28 createDOM('content', {'id': 'content-2
0'})), | |
29 createDOM('content', {'id': 'content-10'})
)), | |
30 createDOM('div', {'id': 'child-10'})))); | |
31 | |
32 shouldBeEqualAsArray(document.getElementById('child-10').getDestinationInsertion
Points(), | |
33 [getNodeInComposedTree('host-10/content-10')]); | |
34 | |
35 document.body.appendChild( | |
36 createDOM('div', {}, | |
37 createDOM('div', {'id': 'host-11'}, | |
38 createShadowRoot( | |
39 createDOM('div', {'id': 'host-21'}, | |
40 attachShadow( | |
41 {'mode': 'closed'}, | |
42 createDOM('content', {'id': 'content-2
1'})), | |
43 createDOM('content', {'id': 'content-11'})
)), | |
44 createDOM('div', {'id': 'child-11'})))); | |
45 | |
46 shouldBeEqualAsArray(document.getElementById('child-11').getDestinationInsertion
Points(), | |
47 [getNodeInComposedTree('host-11/content-11')]); | |
48 | |
49 document.body.appendChild( | |
50 createDOM('div', {}, | |
51 createDOM('div', {'id': 'host-12'}, | |
52 attachShadow( | |
53 {'mode': 'closed'}, | |
54 createDOM('div', {'id': 'host-22'}, | |
55 createShadowRoot( | |
56 createDOM('content', {'id': 'content-2
2'})), | |
57 createDOM('content', {'id': 'content-12'})
)), | |
58 createDOM('div', {'id': 'child-12'})))); | |
59 | |
60 shouldBe('document.getElementById("child-12").getDestinationInsertionPoints().le
ngth', '0'); | |
61 </script> | |
OLD | NEW |