|
50 | 50 |
|
51 | 51 | <div id=open2>
|
52 | 52 | <template shadowrootmode=open shadowrootdelegatesfocus>
|
53 |
| - Open, delegates focus (not the default), named slot assignment (the default) |
| 53 | + Open, delegates focus (not the default), |
| 54 | + named slot assignment (the default), clonable (the default for declarative) |
54 | 55 | </template>
|
55 | 56 | </div>
|
56 | 57 |
|
57 | 58 | <script>
|
58 | 59 | test((t) => {
|
59 | 60 | assert_throws_dom("NotSupportedError",() => {
|
60 |
| - open2.attachShadow({mode: "closed", delegatesFocus: true, slotAssignment: "named"}); |
| 61 | + open2.attachShadow({mode: "closed", delegatesFocus: true, slotAssignment: "named", clonable: true}); |
61 | 62 | },'Mismatched shadow root type should throw');
|
62 | 63 | assert_throws_dom("NotSupportedError",() => {
|
63 |
| - open2.attachShadow({mode: "open", delegatesFocus: false, slotAssignment: "named"}); |
| 64 | + open2.attachShadow({mode: "open", delegatesFocus: false, slotAssignment: "named", clonable: true}); |
64 | 65 | },'Mismatched shadow root delegatesFocus should throw');
|
65 | 66 | assert_throws_dom("NotSupportedError",() => {
|
66 |
| - open2.attachShadow({mode: "open", delegatesFocus: true, slotAssignment: "manual"}); |
| 67 | + open2.attachShadow({mode: "open", delegatesFocus: true, slotAssignment: "manual", clonable: true}); |
67 | 68 | },'Mismatched shadow root slotAssignment should throw');
|
| 69 | + // See https://github.com/whatwg/html/issues/10107: the behavior of the |
| 70 | + // clonable flag is still being discussed. |
| 71 | + // assert_throws_dom("NotSupportedError",() => { |
| 72 | + // open2.attachShadow({mode: "open", delegatesFocus: true, slotAssignment: "named", clonable: false}); |
| 73 | + // },'Mismatched shadow root clonable should throw'); |
| 74 | + |
68 | 75 | const initialShadow = open2.shadowRoot;
|
69 |
| - const shadow = open2.attachShadow({mode: "open", delegatesFocus: true, slotAssignment: "named"}); // Shouldn't throw |
| 76 | + const shadow = open2.attachShadow({mode: "open", delegatesFocus: true, slotAssignment: "named", clonable: true}); // Shouldn't throw |
70 | 77 | assert_equals(shadow,initialShadow,'Same shadow should be returned');
|
71 | 78 | assert_equals(shadow.textContent,'','Shadow should be empty');
|
72 | 79 | },'Calling attachShadow() on declarative shadow root must match all parameters');
|
|
0 commit comments