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="wrapper"> | |
6 <slot id="slot1"></slot> | |
7 <slot id="slot2"> | |
8 <div id="child1"></div> | |
9 </slot> | |
10 <slot id="slot3"> | |
11 <div id="child2"></div> | |
12 <slot id="slot4"> | |
13 <div id="child3"></div> | |
14 <div id="child4"></div> | |
15 </slot> | |
16 </slot> | |
17 </div> | |
18 <script> | |
19 'use strict'; | |
20 | |
21 removeWhiteSpaceOnlyTextNodes(wrapper); | |
22 | |
23 test(() => { | |
24 assert_equals(child1.assignedSlot, null); | |
25 assert_equals(child2.assignedSlot, null); | |
26 assert_equals(child3.assignedSlot, null); | |
27 assert_equals(child4.assignedSlot, null); | |
28 }, 'assignedSlot'); | |
29 | |
30 test(() => { | |
31 assert_array_equals(slot1.assignedNodes(), []); | |
32 assert_array_equals(slot2.assignedNodes(), []); | |
33 assert_array_equals(slot3.assignedNodes(), []); | |
34 assert_array_equals(slot4.assignedNodes(), []); | |
35 }, 'assignedNodes'); | |
36 | |
37 test(() => { | |
38 assert_array_equals(slot1.assignedNodes({ flatten: true }), []); | |
39 assert_array_equals(slot2.assignedNodes({ flatten: true }), [child1]); | |
40 assert_array_equals(slot3.assignedNodes({ flatten: true }), [child2, child3, c
hild4]); | |
41 assert_array_equals(slot4.assignedNodes({ flatten: true }), [child3, child4]); | |
42 }, 'assignedNodes({ flatten: true })'); | |
43 </script> | |
OLD | NEW |