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="d1"> | |
6 <template data-mode="open"> | |
7 <div id="d1_d1"> | |
8 <template data-mode="open"> | |
9 <slot id="d1_d1_s1" name="d1_d1_s1"></slot> | |
10 </template> | |
11 <slot id="d1_s1" name="d1_s1" slot="d1_d1_s1"></slot> | |
12 </div> | |
13 </template> | |
14 </div> | |
15 <script> | |
16 'use strict'; | |
17 | |
18 let n = createTestTree(d1); | |
19 removeWhiteSpaceOnlyTextNodes(n.d1); | |
20 | |
21 test(() => { | |
22 assert_array_equals(n.d1_s1.assignedNodes(), []); | |
23 assert_array_equals(n.d1_s1.assignedNodes({ flatten: true }), []); | |
24 assert_array_equals(n.d1_d1_s1.assignedNodes(), [n.d1_s1]); | |
25 assert_array_equals(n.d1_d1_s1.assignedNodes({ flatten: true }), []); | |
26 | |
27 let d1_d2 = document.createElement('div'); | |
28 d1_d2.setAttribute('id', 'd1_d2'); | |
29 n.d1_s1.appendChild(d1_d2); | |
30 | |
31 assert_array_equals(n.d1_s1.assignedNodes({ flatten: true }), [d1_d2]); | |
32 assert_array_equals(n.d1_d1_s1.assignedNodes({ flatten: true }), [d1_d2]); | |
33 }, "Distribution should be updated after mutating fallback contents"); | |
34 </script> | |
OLD | NEW |