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