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