| 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 <script src="resources/shadow-dom.js"></script> | 3 <script src="resources/shadow-dom.js"></script> |
| 4 <body></body> | 4 <body></body> |
| 5 <script> | 5 <script> |
| 6 description("Tests for getDestinationInsertionPoints()."); | 6 description("Tests for getDestinationInsertionPoints()."); |
| 7 | 7 |
| 8 document.body.appendChild( | 8 document.body.appendChild( |
| 9 createDOM('div', {}, | 9 createDOM('div', {}, |
| 10 createDOM('div', {'id': 'host-1'}, | 10 createDOM('div', {'id': 'host-1'}, |
| 11 createShadowRoot( | 11 createShadowRoot( |
| 12 createDOM('content', {'id': 'content-1'})), | 12 createDOM('content', {'id': 'content-1'})), |
| 13 createDOM('div', {'id': 'child-1'})))); | 13 createDOM('div', {'id': 'child-1'})))); |
| 14 | 14 |
| 15 shouldBeEqualAsArray(document.getElementById('child-1').getDestinationInsertionP
oints(), | 15 shouldBeEqualAsArray(document.getElementById('child-1').getDestinationInsertionP
oints(), |
| 16 [getNodeInTreeOfTrees('host-1/content-1')]); | 16 [getNodeInTreeOfTrees('host-1/content-1')]); |
| 17 | 17 |
| 18 debug('Insertion points should be inactive in v1 shadow trees.'); |
| 19 |
| 18 document.body.appendChild( | 20 document.body.appendChild( |
| 19 createDOM('div', {}, | 21 createDOM('div', {}, |
| 20 createDOM('div', {'id': 'host-2'}, | 22 createDOM('div', {'id': 'host-2'}, |
| 21 createShadowRoot( | 23 createShadowRoot( |
| 22 {'mode': 'open'}, | 24 {'mode': 'open'}, |
| 23 createDOM('content', {'id': 'content-2'})), | 25 createDOM('content', {'id': 'content-2'})), |
| 24 createDOM('div', {'id': 'child-2'})))); | 26 createDOM('div', {'id': 'child-2'})))); |
| 25 | 27 |
| 26 shouldBeEqualAsArray(document.getElementById('child-2').getDestinationInsertionP
oints(), | 28 shouldBe('document.getElementById("child-2").getDestinationInsertionPoints().len
gth', '0'); |
| 27 [getNodeInTreeOfTrees('host-2/content-2')]); | |
| 28 | 29 |
| 29 document.body.appendChild( | 30 document.body.appendChild( |
| 30 createDOM('div', {}, | 31 createDOM('div', {}, |
| 31 createDOM('div', {'id': 'host-3'}, | 32 createDOM('div', {'id': 'host-3'}, |
| 32 createShadowRoot( | 33 createShadowRoot( |
| 33 {'mode': 'closed'}, | 34 {'mode': 'closed'}, |
| 34 createDOM('content', {'id': 'content-3'})), | 35 createDOM('content', {'id': 'content-3'})), |
| 35 createDOM('div', {'id': 'child-3'})))); | 36 createDOM('div', {'id': 'child-3'})))); |
| 36 | 37 |
| 37 debug('Only unclosed insertion points should be returned for getDestinationInser
tionPoints().'); | |
| 38 shouldBe('document.getElementById("child-3").getDestinationInsertionPoints().len
gth', '0'); | 38 shouldBe('document.getElementById("child-3").getDestinationInsertionPoints().len
gth', '0'); |
| 39 | 39 |
| 40 </script> | 40 </script> |
| OLD | NEW |