Skip to content

Commit c8d4d8d

Browse files
committed
Added shadowroot to HTMLTemplateElement for feature detection
1 parent ee65734 commit c8d4d8d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

source

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58308,6 +58308,7 @@ interface <dfn>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
5830858308
[<span>HTMLConstructor</span>] constructor();
5830958309

5831058310
readonly attribute <span>DocumentFragment</span> <span data-x="dom-template-content">content</span>;
58311+
readonly attribute ShadowRoot? <span data-x="dom-template-shadowroot">shadowRoot</span>;
5831158312
};</code></pre>
5831258313
</dd>
5831358314
<dd w-dev>Uses <code>HTMLTemplateElement</code>.</dd>
@@ -58326,6 +58327,15 @@ interface <dfn>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
5832658327
of the <code>template</code> element's content model, since its content model is defined as <span
5832758328
data-x="concept-content-nothing">nothing</span>.</p>
5832858329

58330+
<p class="note">The <code data-x="dom-template-shadowroot">shadowRoot</code> attribute on HTMLTemplateElement is present for feature detection
58331+
of declarative Shadow DOM:</p>
58332+
58333+
<pre><code class="html" data-x="">&lt;script>
58334+
function supportsDeclarativeShadowDOM() {
58335+
return HTMLTemplateElement.prototype.hasOwnProperty("shadowRoot");
58336+
}
58337+
&lt;/script></code></pre>
58338+
5832958339
<div class="example" id="template-example">
5833058340

5833158341
<p>For example, consider the following document:</p>
@@ -58453,6 +58463,9 @@ interface <dfn>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
5845358463
property is true, then the <code data-x="dom-template-content">content</code> attribute must return
5845458464
null instead.</p>
5845558465

58466+
<p>The <dfn><code data-x="dom-template-shadowroot">shadowroot</code></dfn> IDL attribute must return
58467+
its base Element's <a href="https://dom.spec.whatwg.org/#dom-element-shadowroot">shadowroot</a> value.
58468+
5845658469
<hr>
5845758470

5845858471
<p>The <span data-x="concept-node-clone-ext">cloning steps</span> for a <code>template</code>

0 commit comments

Comments
 (0)