From 18985600cb8af031183e52b5fc76237827a84be0 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Sun, 26 Apr 2020 10:21:54 -0700 Subject: [PATCH] Added shadowroot to HTMLTemplateElement for feature detection --- source | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source b/source index d99b6a4652e..cc2a9b7a388 100644 --- a/source +++ b/source @@ -59047,6 +59047,7 @@ interface HTMLTemplateElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute DocumentFragment content; + readonly attribute ShadowRoot? shadowRoot; };
Uses HTMLTemplateElement.
@@ -59065,6 +59066,15 @@ interface HTMLTemplateElement : HTMLElement { of the template element's content model, since its content model is defined as nothing.

+

The shadowRoot attribute on HTMLTemplateElement is present for feature detection + of declarative Shadow DOM:

+ +
<script>
+  function supportsDeclarativeShadowDOM() {
+    return HTMLTemplateElement.prototype.hasOwnProperty("shadowRoot");
+  }
+</script>
+

For example, consider the following document:

@@ -59193,6 +59203,9 @@ interface HTMLTemplateElement : HTMLElement { property is true, then the content attribute must return null instead.

+

The shadowroot IDL attribute must return + its base Element's shadowroot value. +


The cloning steps for a template