| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../resources/testharness.js"></script> | |
| 3 <script src="../resources/testharnessreport.js"></script> | |
| 4 <script src="resources/shadow-dom.js"></script> | |
| 5 <div id="host"> | |
| 6 <template data-mode="open"> | |
| 7 <slot id="slot1" name="slot1"> | |
| 8 <div id="fallback1"></div> | |
| 9 </slot> | |
| 10 <slot id="slot2" name="slot2"> | |
| 11 <div id="fallback2"></div> | |
| 12 </slot> | |
| 13 </template> | |
| 14 <div id="child1" slot="slot1"></div> | |
| 15 </div> | |
| 16 <script> | |
| 17 'use strict'; | |
| 18 | |
| 19 let n = createTestTree(host); | |
| 20 removeWhiteSpaceOnlyTextNodes(n.host); | |
| 21 | |
| 22 test(() => { | |
| 23 assert_equals(n.child1.assignedSlot, n.slot1); | |
| 24 }, "assignedSlot"); | |
| 25 | |
| 26 test(() => { | |
| 27 assert_array_equals(n.slot1.assignedNodes(), [n.child1]); | |
| 28 assert_array_equals(n.slot2.assignedNodes(), []); | |
| 29 }, "assignedNodes"); | |
| 30 | |
| 31 test(() => { | |
| 32 assert_array_equals(n.slot1.assignedNodes({ flatten: true }), [n.child1]); | |
| 33 assert_array_equals(n.slot2.assignedNodes({ flatten: true }), [n.fallback2]); | |
| 34 }, "assignedNodes({ flatten: true }))"); | |
| 35 </script> | |
| OLD | NEW |