Skip to content

Commit d855d16

Browse files
committed
Add shadowrootclonable and make declarative shadow roots not clonable by default
- [ ] At least two implementers are interested (and none opposed): * Chromium * [WebKit](whatwg#10107 (comment)) * [Gecko](whatwg#10107 (comment)) - [X] [Tests](https://github.com/web-platform-tests/wpt) are written and can be reviewed and commented upon at: * https://wpt.fyi/results/shadow-dom/shadow-root-clonable.html - [X] [Implementation bugs](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) are filed: * Chromium: https://crbug.com/1510466 * Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1868428 * WebKit: https://bugs.webkit.org/show_bug.cgi?id=266227 - [ ] [MDN issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed: … - [X] The top of this comment includes a [clear commit message](https://github.com/whatwg/meta/blob/main/COMMITTING.md) to use. (See [WHATWG Working Mode: Changes](https://whatwg.org/working-mode#changes) for more details.) @annevk @emilio
1 parent f406d8a commit d855d16

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

Diff for: source

+29-7
Original file line numberDiff line numberDiff line change
@@ -3135,7 +3135,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
31353135
<li><dfn data-x-href="https://dom.spec.whatwg.org/#concept-node-document">node document</dfn> concept</li>
31363136
<li><dfn data-x="concept-document-type" data-x-href="https://dom.spec.whatwg.org/#concept-document-type">document type</dfn> concept</li>
31373137
<li><dfn data-x="concept-DocumentFragment-host" data-x-href="https://dom.spec.whatwg.org/#concept-documentfragment-host">host</dfn> concept</li>
3138-
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</dfn> concept, and its <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-delegates-focus">delegates focus</dfn> and <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-available-to-element-internals">available to element internals</dfn>.</li>
3138+
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-shadow-root">shadow root</dfn> concept, and its <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-delegates-focus">delegates focus</dfn>, <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-available-to-element-internals">available to element internals</dfn>, and <dfn data-x-href="https://dom.spec.whatwg.org/#shadowroot-clonable">clonable</dfn>.</li>
31393139
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#element-shadow-host">shadow host</dfn> concept</li>
31403140
<li><dfn data-x-href="https://dom.spec.whatwg.org/#interface-htmlcollection"><code>HTMLCollection</code></dfn> interface, its
31413141
<dfn data-x="dom-HTMLCollection-length" data-x-href="https://dom.spec.whatwg.org/#dom-htmlcollection-length"><code>length</code></dfn> attribute, and its
@@ -63197,6 +63197,7 @@ not-slash = %x0000-002E / %x0030-10FFFF
6319763197
<dd><span>Global attributes</span></dd>
6319863198
<dd><code data-x="attr-template-shadowrootmode">shadowrootmode</code></dd>
6319963199
<dd><code data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus</code></dd>
63200+
<dd><code data-x="attr-template-shadowrootclonable">shadowrootclonable</code></dd>
6320063201
<dt><span
6320163202
data-x="concept-element-accessibility-considerations">Accessibility considerations</span>:</dt>
6320263203
<dd><a href="https://w3c.github.io/html-aria/#el-template">For authors</a>.</dd>
@@ -63210,6 +63211,7 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6321063211
readonly attribute <span>DocumentFragment</span> <span data-x="dom-template-content">content</span>;
6321163212
[<span>CEReactions</span>] attribute DOMString <span data-x="dom-template-shadowrootmode">shadowRootMode</span>;
6321263213
[<span>CEReactions</span>] attribute boolean <span data-x="dom-template-shadowrootdelegatesfocus">shadowRootDelegatesFocus</span>;
63214+
[<span>CEReactions</span>] attribute boolean <span data-x="dom-template-shadowrootclonable">shadowRootClonable</span>;
6321363215
};</code></pre>
6321463216
</dd>
6321563217
<dd w-dev>Uses <code>HTMLTemplateElement</code>.</dd>
@@ -63250,6 +63252,10 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6325063252
data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus</code></dfn> content
6325163253
attribute is a <span>boolean attribute</span>.</p>
6325263254

63255+
<p>The <dfn element-attr for="template"><code
63256+
data-x="attr-template-shadowrootclonable">shadowrootclonable</code></dfn> content
63257+
attribute is a <span>boolean attribute</span>.</p>
63258+
6325363259
<p>The <span>template contents</span> of a <code>template</code> element <a
6325463260
href="#template-syntax">are not children of the element itself</a>.</p>
6325563261

@@ -63391,6 +63397,12 @@ interface <dfn interface>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
6339163397
data-x="attr-template-shadowrootdelegatesfocus">shadowrootdelegatesfocus</code> content
6339263398
attribute.</p>
6339363399

63400+
<p>The <dfn><code
63401+
data-x="dom-template-shadowrootclonable">shadowRootClonable</code></dfn> IDL attribute
63402+
must <span>reflect</span> the <code
63403+
data-x="attr-template-shadowrootclonable">shadowrootclonable</code> content
63404+
attribute.</p>
63405+
6339463406
<hr>
6339563407

6339663408
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for a <code>template</code>
@@ -126130,9 +126142,14 @@ document.body.appendChild(text);
126130126142
attribute, then let <var>declarative shadow delegates focus</var> be true. Otherwise let
126131126143
it be false.</p></li>
126132126144

126145+
<li><p>If <var>template start tag</var> had a
126146+
<code data-x="attr-template-shadowrootclonable">shadowrootclonable</code>
126147+
attribute, then let <var>clonable</var> be true. Otherwise let it be false.</p></li>
126148+
126133126149
<li><p><span data-x="concept-attach-a-shadow-root">Attach a shadow root</span> with
126134-
<var>declarative shadow host element</var>, <var>declarative shadow mode</var>, true,
126135-
<var>declarative shadow delegates focus</var>, and "<code data-x="">named</code>".</p></li>
126150+
<var>declarative shadow host element</var>, <var>declarative shadow mode</var>,
126151+
<var>clonable>, <var>declarative shadow delegates focus</var>, and
126152+
"<code data-x="">named</code>".</p></li>
126136126153

126137126154
<li>
126138126155
<p>If an exception was thrown by <span data-x="concept-attach-a-shadow-root">attach a
@@ -138966,10 +138983,15 @@ interface <dfn interface>External</dfn> {
138966138983
<td> "<code data-x="">open</code>";
138967138984
"<code data-x="">closed</code>"
138968138985
<tr>
138969-
<th> <code data-x="">shadowrootdelegatesfocus</code>
138970-
<td> <code data-x="attr-template-shadowrootdelegatesfocus">template</code>
138971-
<td> Sets <span>delegates focus</span> on a declarative shadow root
138972-
<td> <span>Boolean attribute</span>
138986+
<th> <code data-x="">shadowrootdelegatesfocus</code>
138987+
<td> <code data-x="attr-template-shadowrootdelegatesfocus">template</code>
138988+
<td> Sets <span>delegates focus</span> on a declarative shadow root
138989+
<td> <span>Boolean attribute</span>
138990+
<tr>
138991+
<th> <code data-x="">shadowrootclonable</code>
138992+
<td> <code data-x="attr-template-shadowrootclonable">template</code>
138993+
<td> Sets <span>clonable</span> on a declarative shadow root
138994+
<td> <span>Boolean attribute</span>
138973138995
<tr>
138974138996
<th> <code data-x="">shape</code>
138975138997
<td> <code data-x="attr-area-shape">area</code>

0 commit comments

Comments
 (0)