Skip to content

Commit

Permalink
Added shadowroot to HTMLTemplateElement for feature detection
Browse files Browse the repository at this point in the history
  • Loading branch information
mfreed7 committed Apr 26, 2020
1 parent ee65734 commit c8d4d8d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -58308,6 +58308,7 @@ interface <dfn>HTMLTemplateElement</dfn> : <span>HTMLElement</span> {
[<span>HTMLConstructor</span>] constructor();

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

<p class="note">The <code data-x="dom-template-shadowroot">shadowRoot</code> attribute on HTMLTemplateElement is present for feature detection
of declarative Shadow DOM:</p>

<pre><code class="html" data-x="">&lt;script>
function supportsDeclarativeShadowDOM() {
return HTMLTemplateElement.prototype.hasOwnProperty("shadowRoot");
}
&lt;/script></code></pre>

<div class="example" id="template-example">

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

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

<hr>

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

0 comments on commit c8d4d8d

Please sign in to comment.