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